software reset #579
-
Is there a "software restar command" for the Moddable Two? (like reset button) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There is a restart function available as part of some examples. There is not, however, a standalone restart function. We should do that, and the Host Provider Instance in our work with Ecma TC53 is probably a good place for it. Meanwhile, it is easy to add yourself. The details are explained step-by-step in our book, IoT Development for ESP32 and ESP8266 with JavaScript, in the "Adding Native Code" chapter. Restart is very much like the random integer example on pages 521-523.. I'll just give a quick summary here. You need to add one file to your project folder. Name it #include "xs.h"
void xs_restart(xsMachine *the)
{
esp_restart();
} Then in your project, declare a JavaScript function to connect to the native function (the function restart() @ "xs_restart"
restart(); To build {
"include": "$(MODDABLE)/examples/manifest_base.json",
"modules": {
"*": [
"./main",
"./restart"
]
}
} Good luck! |
Beta Was this translation helpful? Give feedback.
There is a restart function available as part of some examples. There is not, however, a standalone restart function. We should do that, and the Host Provider Instance in our work with Ecma TC53 is probably a good place for it.
Meanwhile, it is easy to add yourself. The details are explained step-by-step in our book, IoT Development for ESP32 and ESP8266 with JavaScript, in the "Adding Native Code" chapter. Restart is very much like the random integer example on pages 521-523..
I'll just give a quick summary here. You need to add one file to your project folder. Name it
restart.c
. It just contains a native function to invoke the restart function in the ESP-IDF: