Hi, what's the best practice for making sure the SD card gets properly unmounted? Of course this could be done with a button, but that's cumbersome.
I'm developing a logger for my brainwave recorder which basically is supposed to write data to the SD card for hours at a low data rate. The way I'm currently doing it is I append the new data to a variable and every 5 seconds I append the contents of that variable to a file and immediately unmount the SD. I also turn on an LED while this takes place. That way, the user can easily turn off the device or remove the SD in the 5 second intervals while the LED is off.
Is there anything bad about unmounting and re-mounting the SD all the time? Any other reason why this is bad practice?
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.
Hi, what's the best practice for making sure the SD card gets properly unmounted? Of course this could be done with a button, but that's cumbersome.
I'm developing a logger for my brainwave recorder which basically is supposed to write data to the SD card for hours at a low data rate. The way I'm currently doing it is I append the new data to a variable and every 5 seconds I append the contents of that variable to a file and immediately unmount the SD. I also turn on an LED while this takes place. That way, the user can easily turn off the device or remove the SD in the 5 second intervals while the LED is off.
Is there anything bad about unmounting and re-mounting the SD all the time? Any other reason why this is bad practice?