Fixed endianness reordering in MD380 display driver, now it reorders only the lines to be rendered instead of the whole framebuffer

replace/b4ff6b1f0addbe06a7fafd3766b91e494fcc54be
Silvano Seva 2020-10-20 11:18:47 +02:00 zatwierdzone przez Niccolò Izzo
rodzic 027c62b96e
commit e5decb7244
1 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -408,15 +408,19 @@ void display_renderRows(uint8_t startRow, uint8_t endRow)
gpio_clearPin(CS);
/*
* First of all, convert all pixels from little to big endian, for
* First of all, convert pixels from little to big endian, for
* compatibility with the display driver. We do this after having brought
* the CS pin low, in this way user code calling the renderingInProgress
* function gets true as return value and does not stomp our work.
*/
for(size_t i = 0; i < SCREEN_HEIGHT * SCREEN_WIDTH; i++)
for(uint8_t y = startRow; y < endRow; y++)
{
uint16_t pixel = frameBuffer[i];
frameBuffer[i] = __builtin_bswap16(pixel);
for(uint8_t x = 0; x < SCREEN_WIDTH; x++)
{
size_t pos = x + y * SCREEN_WIDTH;
uint16_t pixel = frameBuffer[pos];
frameBuffer[ipos] = __builtin_bswap16(pixel);
}
}
/* Configure start and end rows in display driver */