You are reading a single comment by @DrAzzy and its replies. Click here to read the full conversation.
  • Now, you may be wondering what the point of the cleanup() function is...

    If I have a microcontroller with saved code on it which I use, I will often do something like this for onInit()

    function onInit() {
    pinMode(C5,'input_pullup'); //this is connected to a button to ground. 
    delete onInit();

    So I can enter maintenance mode by holding down that button on reboot, and in that mode, I can connect to the console, load the utility functions from the eeprom and modify the functions in it, and then call cleanup(), and then if I need to modify the normal code too, I can call save() and there won't be any cruft from the eeprom maintenance to clog up the saved code.


Avatar for DrAzzy @DrAzzy started