I do not know the detail code, but some of the callbacks are called multiple times and are passed state, and the (app) software has to check for the expected state... this allows to work with just one callback versus many, one for each different states.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I do not know the detail code, but some of the callbacks are called multiple times and are passed state, and the (app) software has to check for the expected state... this allows to work with just one callback versus many, one for each different states.