From bf1fa5f26978042161349feff27cb9d958d988da Mon Sep 17 00:00:00 2001 From: Markus Hitter Date: Sun, 14 Jun 2015 18:13:40 +0200 Subject: [PATCH] SD card: add a note about a possible performance optimisation. --- pff_diskio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pff_diskio.c b/pff_diskio.c index c91664e..baeada1 100644 --- a/pff_diskio.c +++ b/pff_diskio.c @@ -188,6 +188,11 @@ DRESULT disk_readp(BYTE* buffer, DWORD sector, UINT offset, UINT count) { /* Receive the requested part of the sector. */ do { + /** + Note that this isn't optimised for performance. The increment and + the dereferencing could be done while waiting for the SPIF bit + to become set in spi_rw(). See http://www.matuschek.net/atmega-spi/. + */ *buffer++ = spi_rw(0xFF); } while (--count);