diff --git a/avrtft.c b/avrtft.c index 4146af1..bdc9a1f 100644 --- a/avrtft.c +++ b/avrtft.c @@ -66,7 +66,7 @@ DDR_DISP |= (1 << PIN_RST); // drive SPI and display output pins high - PORT_DSPI |= (1 << PIN_SDCS); + PORT_SDC |= (1 << PIN_SDCS); PORT_DSPI |= (1 << PIN_DCS); PORT_DSPI |= (1 << PIN_DC); PORT_DISP |= (1 << PIN_RST); diff --git a/bmp.c b/bmp.c index 0f4f344..01d417a 100644 --- a/bmp.c +++ b/bmp.c @@ -182,8 +182,11 @@ bool success = readSingleBlock(address++, block); displaySel(); if (success) { - for (uint16_t i = 0; i < SD_BLOCK_SIZE && status == BMP_BUSY; i++) { + for (uint16_t i = 0; i < SD_BLOCK_SIZE; i++) { status = streamBMP(block[i]); + if (status != BMP_BUSY) { + break; + } } } else { break;