did you mis-read your calendar? It's the 15th, not the 25th
I know... I was tempting, but if I messed something up I didn't want to spend boxing day hunched over a laptop trying to fix it :)
What was the issue with the spikes while changing pin state?
If the pin was an input and hadn't been previously set - but then you wrote 1 to it then the pin would be set to an output (outputting 0) before it output 1. @allObjects found it. Most people wouldn't have noticed and it was easy to work around with pinMode, but it's one less thing to trip people up :)
E.errorFlag - does this mean that we could, say, react to these internal errors by rebooting the Espruino with load()?
Yes, absolutely! It'd definitely be useful for things like out of memory.
To be absolutely sure, the watchdog timer could be used as well, but it's another handy thing to be able to check.
How does unsyncFiles work? If we're not syncing it to the SD card after each write, how and when does it decide to actually sync the file to the SD card?
It syncs when you close the file, or you can also flip the flag off and write something, and that'll sync it as well. There's no difference to fs.writeFile and fs.appendFile, it's just when you write to something opened with E.openFile that it takes effect.
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 know... I was tempting, but if I messed something up I didn't want to spend boxing day hunched over a laptop trying to fix it :)
If the pin was an input and hadn't been previously set - but then you wrote
1
to it then the pin would be set to an output (outputting 0) before it output1
. @allObjects found it. Most people wouldn't have noticed and it was easy to work around withpinMode
, but it's one less thing to trip people up :)Yes, absolutely! It'd definitely be useful for things like out of memory.
To be absolutely sure, the watchdog timer could be used as well, but it's another handy thing to be able to check.
It syncs when you close the file, or you can also flip the flag off and write something, and that'll sync it as well. There's no difference to
fs.writeFile
andfs.appendFile
, it's just when you write to something opened withE.openFile
that it takes effect.