Commit Graph

4 Commits

Author SHA1 Message Date
Markus Hitter 017e17801c SD card: move parsing closer to the metal.
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%
2015-07-17 13:31:03 +02:00
Markus Hitter 9de0c65460 SD card: add the layer between hardware and Petit FatFs.
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.
2015-07-05 23:32:48 +02:00
Markus Hitter 0a013d6e5e SD card: wrap Petit FatFs code in #ifdef SD.
No need to compile this when not needed and also make sure it's
nowhere used with SD card support disabled.
2015-07-05 23:32:48 +02:00
Markus Hitter 846d575aee SD card: add Petit FatFs to Teacup Firmware.
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.
2015-07-05 23:32:48 +02:00