When I reboot (long press BNT1 + BTN2) the state is lost.
So I guess that during the hardware setup stage, the state of all registers is initialized to some defaults. As a consequence, my flag is set to 0.
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.
When I reboot (long press BNT1 + BTN2) the state is lost.
So I guess that during the hardware setup stage, the state of all registers is initialized to some defaults. As a consequence, my flag is set to 0.