avsa242 / sdfat-spin

FAT-fs on SD implementation for the P8X32A/Propeller, P2X8C4M64P/Propeller 2
Other
0 stars 0 forks source link

fread() should only read a block from SD if it needs to #21

Open avsa242 opened 1 year ago

avsa242 commented 1 year ago

Currently, it reads a block (even re-reading the current one) every time it's called, as long as the seek pointer is before the EOF. Example: fread() is called to read 10 bytes. A full 512 byte sector is read in. If the next call only reads another 10 bytes, it should simply copy the data from the sector buffer instead of re-reading the sector.