kamocat / plog

Portable, simple and extensible C++ logging library. Ported to Arduino
Mozilla Public License 2.0
0 stars 1 forks source link

Recover from removed SD card #6

Open kamocat opened 4 years ago

kamocat commented 4 years ago

We need the ability to recover from an SD being removed and reinserted. I would prefer this to be automatic. There are three scenarios that make this necessary:

kamocat commented 4 years ago

I added a function to reopen a file in #8 This doesn't actually detect when the SD card is removed, though. https://github.com/greiman/SdFat/issues/118

kamocat commented 4 years ago

I noticed that the list directory function doesn't print anything once the SD card is removed. A simple option might be to create an empty hidden file and check for its existence every second. If it's not there, then we can try re-initializing the SD card. If that fails, of course, we probably want to disable the SD card logging.