bool buttonState = false;
buttonState = jshPinInput(BTN1_PININDEX) == BTN1_ONSTATE;
jsiInit(!buttonState); // pressing USER button skips autoload
The code is for the stm32, but it could be replicated for ESP32. Define BTN1_PININDEX (maybe jshardware.c?) and use this code. Actually it would be nice to have it in every board.
© Espruino, powered by microcosm.
Report a problem