Right now even very small writes to a sector write the sector in full to the card, which blocks for a long time. Add logic to wait until the sector buffer is full, or is explicitly flushed by the user.
[x] add a separate metadata buffer
[ ] find a way to eliminate the need to read in the FAT every time fseek() is called, to reduce unnecessary SD access; maybe set a flag indicating what kind of data is currently in the metadata buffer, and if it's the correct FAT sector, then do nothing
[ ] add a method to 'queue' data
[ ] add a mechanism for explicitly flushing the write buffer
[ ] rewrite fwrite() to wait until sector buffer is full
Right now even very small writes to a sector write the sector in full to the card, which blocks for a long time. Add logic to wait until the sector buffer is full, or is explicitly flushed by the user.
fseek()
is called, to reduce unnecessary SD access; maybe set a flag indicating what kind of data is currently in the metadata buffer, and if it's the correct FAT sector, then do nothingfwrite()
to wait until sector buffer is full