• Hi

    Without thinking about it, I created a script with

    var reset=0;

    in the top level. I then used save();

    Once I'd done this, I obviously couldn't use reset() to clear the memory, and
    hard-reset reloaded the same program..

    I really couldn't see how to get out of this. But I messed about for a while and
    eventually somehow it went away.

    If there is a way to undefine a variable or clear the program memory without using
    reset() it would be useful to document here please :)

  • Oops! :)

    You can either:

    delete reset;
    

    Or probably the most important way out (mentioned in troubleshooting) is:

    Press and release RST, and press BTN1 immediately after.

    Not too soon after though (or you'll get the bootloader mode with the glowing LED)...

    Once you've done that, Espruino will start up without loading the saved program. You can then just type save() to save a blank program into flash :)

  • I think I tried delete(reset); and some JS documentation I found online suggested you couldn't delete vars. I probably just missed it.

    I think I found the BTN1 fix by accident.

    Thanks :)

  • No problem... I only implemented delete in Espruino in the past month or so. If you find any documentation on espruino.com that still says it doesn't exist, please can you point me to it? :)

  • Well, entering 'delete' into the search UI gives "no results" which probably stopped me a bit :)

  • Ahh. Yes, it's just a built-in JavaScript keyword, and the search only covers the documentation and function reference. I'll add it to the FAQ...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Funny newbie error - renaming Reset by accident :) :)

Posted by Avatar for mgg1010 @mgg1010

Actions