• @gdanov:
    See targets/stm32_ll/main.c

    bool buttonState = false;
    [#ifdef](http://forum.espruino.com/searc­h/?q=%23ifdef) BTN1_PININDEX
      buttonState = jshPinInput(BTN1_PININDEX) == BTN1_ONSTATE;
    [#endif](http://forum.espruino.com/searc­h/?q=%23endif)
      jsvInit(0);
      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.

About

Avatar for GermanWarez @GermanWarez started