Open IoaSman1 opened 2 years ago
Thanks for this, I'm in the process of testing this at the moment, the code looks good, I'm just wondering if it wouldn't make sense to also include a check for the current sample rate so the block allocation varies depending on the sample rate, e.g.:
// SD_Card_Stuff.ino
// ...
boolean setupSDcard(char limit){
// ...
BLOCK_COUNT = ceil(BLOCK_COUNT / 250 * board.getSampleRate().toInt());
// ...
}
// ...
That way if you use 1000Hz, you'll get a larger file...also this setting shouldn't affect performance as it only happens once during the SD card setup.
I've just noticed that if the data overruns the file there's no footer written to the sdcard (I'll need to have another look but I'm guessing the limit for writing data should be reserved size - footer length
One more fixed is included