This means a custom function in pff_diskio.c, disk_parsep(),
which replaces disk_readp(). Now it no longer reads a whole
sector for every single byte, but only once per line of G-code.
Performance is now much better than with buffered reading, the
1 MB file with 16'468 lines of comments, 64 bytes per line,
read and parses now in just 46 seconds, which means 358 lines
or 22'795 bytes per second.
Unfortunately all the binary size loss is gone compared to the
previous version, we're 68 bytes bigger than before buffer-less
parsing. Reason is the new function disk_parsep() in
pff_diskio.h. RAM usage is still low.
ATmega... '168 '328(P) '644(P) '1280
FLASH: 22276 bytes 155.39% 72.51% 35.09% 17.27%
RAM: 1331 bytes 129.98% 64.99% 32.50% 16.25%
EEPROM: 32 bytes 3.12% 1.56% 1.56% 0.78%
This is all the commands to read from and write to SPI,
initializing the card, read in blocks and so on. This should
make Petit FatFs actually usable.
So far read-only and no M-codes to let end users play with
this stuff.
The demonstration code was changed to list the SD card's
top level directory over and over again.
Some modifications to avoid file name conflicts with other parts and
make it compile. As the glue code to the hardware (spi.c/.h) is
still missing, there are a few warnings, of course.
Changes to this library are tracked in pff.c.