whitecatboard / Lua-RTOS-ESP32

Lua RTOS for ESP32
Other
1.18k stars 221 forks source link

Software reset functionality #285

Closed xopxe closed 5 years ago

xopxe commented 5 years ago

We added a os.reset() call to restart the board (it's just a call to esp_restart())

https://github.com/xopxe/Lua-RTOS-ESP32/commit/b57be16314e271d85fe8df71570ae4d2c548552c

Is it useful?

the0ne commented 5 years ago

Hi @xopxe,

please have a look at the lua function os.exit() which uses os_exit in the same file loslib.c. It calls esp_restart but before it takes care of backtrace handling.

lu1210 commented 5 years ago

Hi, what is the difference to the cpu.sleep(0) function?

xopxe commented 5 years ago

Oh, I grepped esp_restart and somehow missed that. There's a further comment, so feel free to close this whenever you want.

the0ne commented 5 years ago

@lu1210 more or less should be the same outcome but the reset reason will be different @xopxe closing this