Optimize performance: 4-bit SD_MMC, write-only SPI, and hardware byte swapping

This commit is contained in:
drjones
2026-06-30 01:18:01 -07:00
parent e04ee7cfe4
commit 4fa200d649
4 changed files with 29 additions and 32 deletions

View File

@@ -35,7 +35,7 @@ void pngDraw(PNGDRAW *pDraw) {
png.getLineAsRGB565(pDraw, lineBuffer, PNG_RGB565_BIG_ENDIAN, 0xffffffff);
uint32_t size = pDraw->iWidth;
for (size_t i = 0; i < size; i++) {
lineBuffer[i] = (((lineBuffer[i] >> 8) & 0xFF) | ((lineBuffer[i] << 8) & 0xFF00));
lineBuffer[i] = __builtin_bswap16(lineBuffer[i]);
}
LCD_addWindow(xpos, pDraw->y, xpos + pDraw->iWidth - 1, ypos + pDraw->y, lineBuffer);
}