How do I clear memory after a save() #5511
Replies: 1 comment
-
Posted at 2014-10-10 by @gfwilliams All you need to do is a If you just do Posted at 2014-10-10 by DrAzzy save(); will erase the current saved program, and save the current state of the Espruino to flash, and then reset the Espruino (which will then start up with the freshly saved program and call onInit() if that function is defined). If you want to clear the saved program, you can do reset(); (which restarts without loading saved code) and then save(); to save this clean slate. Posted at 2014-10-10 by tobor That seem to work, but I lost the Espruino Banner. Posted at 2014-10-10 by DrAzzy The Espruino banner comes and goes, IME. I've never noticed a pattern in when it does or doesn't show up, though I'm sure there is one. Posted at 2014-10-10 by @gfwilliams Yes, it's a bit odd, but: If Espruino is loading from flash (even if it is loading empty code written by The reason is that if you've saved anything and you connect to a PC, you want to print as little text as possible in case the PC isn't listening to what's being printed - because if the PC isn't reading data, output buffers get full, and the code halts waiting for it to empty again. Posted at 2016-12-11 by ChristianW reset() and save() do not always work for me: Posted at 2016-12-12 by @gfwilliams Just to add the answer here too: If you've set the IDE to To force what you saved that way to be removed, just run Posted at 2016-12-12 by @allObjects oops... should be documented where the save option is can be enabled... Is 'auto-save on/after upload' it using E.setBootCode() internally? Posted at 2016-12-12 by @gfwilliams The 'auto save' option in the IDE? That just tries to save your code into Chrome, so next time you start the IDE it remembers - it doesn't have anything to do with the board |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-10-10 by tobor
It appears to just replace existing functions but not remove the old ones.
Beta Was this translation helpful? Give feedback.
All reactions