Fixed display inversion issues.
This commit is contained in:
committed by
Raphael Coeffic
parent
12ede2ca62
commit
eb4e4af0d2
@@ -532,10 +532,10 @@
|
|||||||
#define LCD_GPIO_NRST GPIOI
|
#define LCD_GPIO_NRST GPIOI
|
||||||
#define LCD_GPIO_PIN_NRST GPIO_Pin_10 // PI.10
|
#define LCD_GPIO_PIN_NRST GPIO_Pin_10 // PI.10
|
||||||
#endif
|
#endif
|
||||||
#if defined(PCBX10) && !defined(RADIO_T18) && !defined(SIMU)
|
#if defined(PCBX10) && !defined(RADIO_T18)
|
||||||
#define LCD_VERTICAL_INVERT
|
#define LCD_VERTICAL_INVERT
|
||||||
#endif
|
#endif
|
||||||
#if defined(PCBX10) && !defined(SIMU)
|
#if defined(PCBX10)
|
||||||
#define LCD_VERTICAL_INVERT
|
#define LCD_VERTICAL_INVERT
|
||||||
#endif
|
#endif
|
||||||
#define LTDC_IRQ_PRIO 4
|
#define LTDC_IRQ_PRIO 4
|
||||||
|
|||||||
@@ -448,7 +448,15 @@ void lcdRefresh()
|
|||||||
static bool lightEnabled = (bool)isBacklightEnabled();
|
static bool lightEnabled = (bool)isBacklightEnabled();
|
||||||
|
|
||||||
if (bool(isBacklightEnabled()) != lightEnabled || memcmp(simuLcdBuf, displayBuf, DISPLAY_BUFFER_SIZE * sizeof(pixel_t))) {
|
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));
|
memcpy(simuLcdBuf, displayBuf, DISPLAY_BUFFER_SIZE * sizeof(pixel_t));
|
||||||
|
#endif
|
||||||
lightEnabled = (bool)isBacklightEnabled();
|
lightEnabled = (bool)isBacklightEnabled();
|
||||||
simuLcdRefresh = true;
|
simuLcdRefresh = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,6 +91,13 @@ void DMACopyAlphaBitmap(uint16_t * dest, uint16_t destw, uint16_t desth, uint16_
|
|||||||
// 'dest' has RGB565
|
// '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)
|
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);
|
RGB_SPLIT(fg_color, red, green, blue);
|
||||||
|
|
||||||
for (coord_t line=0; line<h; line++) {
|
for (coord_t line=0; line<h; line++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user