Skip to content

Commit

Permalink
update: sync video after render
Browse files Browse the repository at this point in the history
  • Loading branch information
ChisBread committed Sep 12, 2022
1 parent 05dc488 commit bc4f61f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
4 changes: 0 additions & 4 deletions Firmware/ESP32/RX5808/main/gui/lvgl_app/page_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ static void event_callback(lv_event_t* event)
beep_on_off(1);
lv_fun_param_delayed(beep_on_off, 100, 0);
}
video_composite_sync_release(40);// 临时取消帧同步,让画面看起来流畅点
if (key_status == LV_KEY_LEFT) {
channel_count--;
if (channel_count < 0)
Expand Down Expand Up @@ -94,9 +93,6 @@ static void event_callback(lv_event_t* event)
}
}
else if (code == LV_EVENT_SHORT_CLICKED) {
if(get_video_switch()) {
video_composite_sync_release(90);// 临时取消帧同步,让画面看起来流畅点
}
beep_on_off(1);
lv_fun_param_delayed(beep_on_off, 100, 0);
page_main_exit();
Expand Down
6 changes: 0 additions & 6 deletions Firmware/ESP32/RX5808/main/gui/lvgl_app/page_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ void Menu_event_callback(lv_event_t* event)
if (code == LV_EVENT_KEY) {
beep_on_off(1);
lv_fun_param_delayed(beep_on_off, 100, 0);
if(get_video_switch()) {
video_composite_sync_release(30);// 临时取消帧同步,让画面看起来流畅点
}
if (key_status == LV_KEY_ENTER) {
if (obj == rx5808_div_menu[item_setup].item_contain) {
page_menu_exit();
Expand All @@ -71,9 +68,6 @@ void Menu_event_callback(lv_event_t* event)
}
}
else if (key_status == LV_KEY_LEFT) {
if(get_video_switch()) {
video_composite_sync_release(160);// 临时取消帧同步,让画面看起来流畅点
}
page_menu_exit();
page_main_create();
}
Expand Down
15 changes: 3 additions & 12 deletions Firmware/ESP32/RX5808/main/gui/lvgl_driver/lv_port_disp.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ lv_disp_drv_t *disp_drv_spi;
lv_disp_t *default_disp = NULL;
bool g_dac_video_render = false;
bool g_dac_video_sync = false;
uint16_t sync_release_times = 0;
uint8_t refresh_times = 0;
static void disp_init(void);

Expand Down Expand Up @@ -54,9 +53,6 @@ void IRAM_ATTR video_composite_switch(bool flag) {
void video_composite_sync_switch(bool flag) {
g_dac_video_sync = flag;
}
void video_composite_sync_release(uint16_t times) {
sync_release_times = times;
}
void lv_port_disp_init(void)
{
/*-------------------------
Expand Down Expand Up @@ -123,13 +119,6 @@ static void IRAM_ATTR disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * are
/*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
//DAC flush
if(g_dac_video_render) {
//加了以后画面更稳定, 但影响UI流畅度
if(g_dac_video_sync && !sync_release_times) {
esp32_video_sync();
}
if(sync_release_times) {
--sync_release_times;
}
lv_color_t *color_p_dac = color_p;
for(int y = area->y1; y <= area->y2; ++y) {
for(int x = area->x1; x <= area->x2; ++x) {
Expand Down Expand Up @@ -165,7 +154,9 @@ void IRAM_ATTR composite_monitor_cb(lv_disp_drv_t * disp_drv, uint32_t time_ms,
lv_obj_invalidate(lv_scr_act());
--refresh_times;
}

if(g_dac_video_render && g_dac_video_sync) {
esp32_video_sync();
}
}
void IRAM_ATTR composite_rounder_cb(lv_disp_drv_t * disp_drv, lv_area_t * area) {
// // RBG16bit的情况下,保证每次刷新的范围都32bit对齐
Expand Down
1 change: 0 additions & 1 deletion Firmware/ESP32/RX5808/main/gui/lvgl_driver/lv_port_disp.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ void lv_port_disp_init(void);
bool get_video_switch(void);
void video_composite_switch(bool flag);
void video_composite_sync_switch(bool flag);
void video_composite_sync_release(uint16_t times);
/**********************
* MACROS
**********************/
Expand Down

0 comments on commit bc4f61f

Please sign in to comment.