Skip to content

Commit

Permalink
Fix for EL18.
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz committed May 31, 2024
1 parent 79f0a67 commit 49caa1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
24 changes: 2 additions & 22 deletions radio/src/gui/colorlcd/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,6 @@ static void flushLcd(lv_disp_drv_t* disp_drv, const lv_area_t* area,
lcd_flush_cb(disp_drv, (uint16_t*)color_p, copy_area);

#if !defined(LCD_VERTICAL_INVERT)
uint16_t* src = (uint16_t*)color_p;
uint16_t* dst = nullptr;
if ((uint16_t*)color_p == LCD_FIRST_FRAME_BUFFER)
dst = LCD_SECOND_FRAME_BUFFER;
else
dst = LCD_FIRST_FRAME_BUFFER;

lv_disp_t* disp = _lv_refr_get_disp_refreshing();
for (int i = 0; i < disp->inv_p; i++) {
if (disp->inv_area_joined[i]) continue;

const lv_area_t& refr_area = disp->inv_areas[i];

auto area_w = refr_area.x2 - refr_area.x1 + 1;
auto area_h = refr_area.y2 - refr_area.y1 + 1;

DMACopyBitmap(dst, LCD_W, LCD_H, refr_area.x1, refr_area.y1, src, LCD_W,
LCD_H, refr_area.x1, refr_area.y1, area_w, area_h);
}
DMAWait(); // wait for the last DMACopyBitmap to be completed before
// sending completion message
lv_disp_flush_ready(disp_drv);
#endif
} else {
Expand Down Expand Up @@ -164,11 +143,12 @@ void lcdInitDisplayDriver()

disp_drv.hor_res = LCD_W; /*Set the horizontal resolution in pixels*/
disp_drv.ver_res = LCD_H; /*Set the vertical resolution in pixels*/
disp_drv.full_refresh = 0;

#if !defined(LCD_VERTICAL_INVERT)
disp_drv.full_refresh = 1;
disp_drv.direct_mode = 1;
#else
disp_drv.full_refresh = 0;
disp_drv.direct_mode = 0;
#endif

Expand Down
4 changes: 2 additions & 2 deletions radio/src/targets/horus/lcd_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ static void startLcdRefresh(lv_disp_drv_t *disp_drv, uint16_t *buffer,
lv_area_t refr_area;
lv_area_copy(&refr_area, &disp->inv_areas[i]);

//TRACE("{%d,%d,%d,%d}", refr_area.x1,
// refr_area.y1, refr_area.x2, refr_area.y2);
// TRACE("Vert invert refresh {%d,%d,%d,%d}", refr_area.x1,
// refr_area.y1, refr_area.x2 - refr_area.x1 + 1, refr_area.y2 - refr_area.y1 + 1);

_rotate_area_180(refr_area);

Expand Down

0 comments on commit 49caa1f

Please sign in to comment.