I'd actually avoid save()ing your code at all and would just flash the bootloader, with some failsafe code if the firmware update fails... So maybe the bootloader & firmware updater, all in one.
... or I guess you could use the V1 as a fallback if needs be, but I'd try and keep the fallback as simple as possible, and ship it with something that the bootloader can load up on to ensure it works correctly!
What is the best way for me to grab the correct V2 minified code
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.
I'd actually avoid
save()
ing your code at all and would just flash the bootloader, with some failsafe code if the firmware update fails... So maybe the bootloader & firmware updater, all in one.... or I guess you could use the V1 as a fallback if needs be, but I'd try and keep the fallback as simple as possible, and ship it with something that the bootloader can load up on to ensure it works correctly!
espruino
fromNPM
: https://www.npmjs.com/package/espruinoespruino -p path_to_espruino_serial_port --minify -o out.js your_input_file.js
Yes, that'd be why you don't include the full V1 code unless you have to :)