• On ESP8266 there are some lines of code after reset() coming from jshReset(), so reset();save(); is not a appropriate option.

    The reason behind this is, that saved code caused trouble on ESP8266 when updating to a new release in the past. Sure "erase_flash" is an option, but works only over serial connection AFAIK.

    But require("Flash").erasePage(addr); will do.

    So this is my clear();

    var clear = function() {
            require('Flash').erasePage(your_save_cod­e_page);
    };
    
    >clear();
    =undefined
    >load();
    =undefined
    No code in flash!
    > 
    

    I purposely did not name addr. If this is helpful for you, than lookup it up at the Espruino ESP8266 board documentation page section "SAVING CODE TO FLASH"

About

Avatar for MaBe @MaBe started