1
0
mirror of https://github.com/whowechina/aic_pico.git synced 2024-11-27 23:10:48 +01:00

Minor gui loop change fix

This commit is contained in:
whowechina 2024-06-18 10:57:09 +08:00
parent 61f9a526a9
commit 7aa1c83f58
3 changed files with 9 additions and 5 deletions

View File

@ -406,8 +406,6 @@ static void sliding_render()
void gui_loop()
{
event_proc();
run_background();
if (slide.sliding) {
@ -416,5 +414,11 @@ void gui_loop()
pages[curr_page].render();
}
st7789_render(true);
st7789_flush(false);
/* Control things when updating LCD */
gui_level(aic_cfg->lcd.backlight);
event_proc();
st7789_vsync();
}

View File

@ -196,7 +196,7 @@ void st7789_vsync()
dma_channel_wait_for_finish_blocking(ctx.spi_dma);
}
void st7789_render(bool vsync)
void st7789_flush(bool vsync)
{
if (dma_channel_is_busy(ctx.spi_dma)) {
return;

View File

@ -18,7 +18,7 @@ uint16_t st7789_get_crop_width();
uint16_t st7789_get_crop_height();
void st7789_dimmer(uint8_t level);
void st7789_vsync();
void st7789_render(bool vsync);
void st7789_flush(bool vsync);
#define st7789_rgb32(r, g, b) ((r << 16) | (g << 8) | b)
#define st7789_rgb565(rgb32) ((rgb32 >> 8) & 0xf800) | ((rgb32 >> 5) & 0x0780) | ((rgb32 >> 3) & 0x001f)