Fixed display inversion issues.

This commit is contained in:
Raphael Coeffic
2021-05-06 12:55:59 +02:00
committed by Raphael Coeffic
parent 12ede2ca62
commit eb4e4af0d2
3 changed files with 17 additions and 2 deletions
+2 -2
View File
@@ -532,10 +532,10 @@
#define LCD_GPIO_NRST GPIOI
#define LCD_GPIO_PIN_NRST GPIO_Pin_10 // PI.10
#endif
#if defined(PCBX10) && !defined(RADIO_T18) && !defined(SIMU)
#if defined(PCBX10) && !defined(RADIO_T18)
#define LCD_VERTICAL_INVERT
#endif
#if defined(PCBX10) && !defined(SIMU)
#if defined(PCBX10)
#define LCD_VERTICAL_INVERT
#endif
#define LTDC_IRQ_PRIO 4
+8
View File
@@ -448,7 +448,15 @@ void lcdRefresh()
static bool lightEnabled = (bool)isBacklightEnabled();
if (bool(isBacklightEnabled()) != lightEnabled || memcmp(simuLcdBuf, displayBuf, DISPLAY_BUFFER_SIZE * sizeof(pixel_t))) {
#if defined(LCD_VERTICAL_INVERT)
auto src = (pixel_t*)displayBuf + DISPLAY_BUFFER_SIZE - 1;
auto dst = simuLcdBuf;
auto end = dst + DISPLAY_BUFFER_SIZE;
while (dst != end) { *(dst++) = *(src--); }
#else
memcpy(simuLcdBuf, displayBuf, DISPLAY_BUFFER_SIZE * sizeof(pixel_t));
#endif
lightEnabled = (bool)isBacklightEnabled();
simuLcdRefresh = true;
}
+7
View File
@@ -91,6 +91,13 @@ void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_
// 'dest' has RGB565
void DMACopyAlphaMask(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_t x, uint16_t y, const uint8_t * src, uint16_t srcw, uint16_t srch, uint16_t srcx, uint16_t srcy, uint16_t w, uint16_t h, uint16_t fg_color)
{
#if defined(LCD_VERTICAL_INVERT)
x = destw - (x + w);
y = desth - (y + h);
srcx = srcw - (srcx + w);
srcy = srch - (srcy + h);
#endif
RGB_SPLIT(fg_color, red, green, blue);
for (coord_t line=0; line<h; line++) {