Fix screenshot function on color lcd

Resolves #93
This commit is contained in:
Raphael Coeffic
2021-05-26 23:45:05 +02:00
parent 3d9b01745e
commit 447d7bde22
+2 -1
View File
@@ -80,7 +80,8 @@ const char * writeScreenshot()
#if defined(COLORLCD)
for (int y = LCD_H - 1; y >= 0; y--) {
for (int x = 0; x < LCD_W; x++) {
auto pixel = *lcd->getPixelPtr(x, y);
lcdFront->reset();
auto pixel = *(lcdFront->getPixelPtr(x, y));
uint32_t dst = (0xFF << 24) + (GET_RED(pixel) << 16) + (GET_GREEN(pixel) << 8) + (GET_BLUE(pixel) << 0);
if (f_write(&bmpFile, &dst, sizeof(dst), &written) != FR_OK || written != sizeof(dst)) {
f_close(&bmpFile);