Silly question, saving to make sure it restarts after power cycle or reset. #3866
Replies: 1 comment
-
Posted at 2021-10-04 by HeneryH_(Henery_Hawk) p.s. I have done both a) most of the logic/programming/timers in the puck.js code and b) the logic/program/timers in Node-Red. This code version is where nearly all of the logic is one in Node-Red. can make a new thread if it gets meaty. Pros/cons? Posted at 2021-10-04 by @allObjects Henry, a good/save/robust practice is to have an Furthermore, below things give me a bit the chill... because this can actually mess with the Espruino platform which may already include running JS (boot code that uses watches, and timers). To avoid having to go with the crow bar but still want to be able to 'cleanup after me-code' or have in the application the need to stop or pause these hw and sw events/hooks, ,I use variables to hold on to the watch, timeout and interval handles and then use them in the clear functions.
What code distribution topology to chose? ...it all depends. The pendulum is always swinging and a hybrid approach feels to me right. Question is: what and where are 'your' pain points? There is allways pain - never no pain - but minimizing it by optimizing is the virtue. Posted at 2021-10-04 by @fanoush
Yes, if you upload this code to flash via WebIDE it is permanently saved in Storage as ".bootcde" file and gets executed from top to bottom at boot time. If this suits you, it is as simple as that, you don't need anything else. Posted at 2021-10-05 by @gfwilliams Not sure, but this might help give some explanation of what happens: http://www.espruino.com/Saving |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-10-04 by HeneryH_(Henery_Hawk)
This seems pretty basic.
If I save a "program" to flash, will it execute again to reload the functions and watches if the battery is changed?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions