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_code_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"
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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();
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"