how to set hasBeenReset
to true in order to avoid running onInit?
#7460
Replies: 1 comment
-
Posted at 2022-01-10 by @gfwilliams Usually Espruino doesn't load code if a button is pressed at boot, but unfortunately it looks like on the normal ESP32 build no pin has been defined for this, so I'm not really sure there's a way. You could always boot to the bootloader mode and then erase the first page of Storage (at 0x320000 I think?) Posted at 2022-01-10 by gdanov Any hints how to set-up a "button" pin? I ended up checking for certain pin in my code which I short or pull up when needed. Posted at 2022-06-26 by GermanWarez @gdanov:
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. Posted at 2022-06-26 by @fanoush Button can be defined in board file, see other boards for BTN1. this 'check button and skip load' is there for nrf52 too so that's basically all boards except ESP. could be added here https://github.com/espruino/Espruino/blob/master/targets/esp32/main.c#L69 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2022-01-07 by gdanov
I have code that runs endless loop:
do some work in the onInit() method, deepSleep, wake-up and over again
it works fine, but I need to be able to stop this endless loop so that I can gain access to the terminal and reset or change code.
Beta Was this translation helpful? Give feedback.
All reactions