From 759c3d7a48cdb3afde3c6ebb6dae46c565006f10 Mon Sep 17 00:00:00 2001 From: Ligen Date: Fri, 9 May 2025 16:00:47 +0800 Subject: [PATCH] set lcd brightness at analog view mode --- src/core/app_state.c | 20 ++++++++++++++++++++ src/core/ht.c | 12 ++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/core/app_state.c b/src/core/app_state.c index 9d8c587..7020115 100644 --- a/src/core/app_state.c +++ b/src/core/app_state.c @@ -10,6 +10,7 @@ #include "core/msp_displayport.h" #include "core/osd.h" #include "driver/dm5680.h" +#include "driver/lcd.h" #include "driver/dm6302.h" #include "driver/hardware.h" #include "driver/it66121.h" @@ -53,6 +54,10 @@ void app_switch_to_menu() { IT66121_init(); system_script(REC_STOP_LIVE); + + // Restore image settings from av module + LCD_Brightness(g_setting.image.oled); + Set_Contrast(g_setting.image.contrast); } void app_exit_menu() { @@ -76,6 +81,12 @@ void app_exit_menu() { void app_switch_to_analog(bool is_avin) { Source_AV(is_avin); + // Solve LCD residual image + if (is_avin == 0) { + LCD_Brightness(7); + Set_Contrast(14); + } + dvr_update_vi_conf(VR_720P50); osd_fhd(0); osd_show(true); @@ -93,6 +104,11 @@ void app_switch_to_analog(bool is_avin) { } void app_switch_to_hdmi_in() { + + // Restore image settings from av module + LCD_Brightness(g_setting.image.oled); + Set_Contrast(g_setting.image.contrast); + Source_HDMI_in(); IT66121_close(); sleep(2); @@ -127,6 +143,10 @@ void app_switch_to_hdmi_in() { void app_switch_to_hdzero(bool is_default) { int ch; + // Restore image settings from av module + LCD_Brightness(g_setting.image.oled); + Set_Contrast(g_setting.image.contrast); + if (is_default) { ch = g_setting.scan.channel - 1; } else { diff --git a/src/core/ht.c b/src/core/ht.c index c240679..f96c121 100644 --- a/src/core/ht.c +++ b/src/core/ht.c @@ -93,7 +93,11 @@ static void detect_motion(bool is_moving) { #endif if (is_moving) { // we got motion, turn oled back on, start over - LCD_Brightness(g_setting.image.oled); + if (g_source_info.source == SOURCE_AV_MODULE) { + LCD_Brightness(7); + } else { + LCD_Brightness(g_setting.image.oled); + } state = OLED_MD_DETECTING; cnt = 0; } @@ -137,7 +141,11 @@ static void detect_motion(bool is_moving) { RTC6715_Open(1); } LOGI("OLED ON from protection."); - LCD_Brightness(g_setting.image.oled); + if (g_source_info.source == SOURCE_AV_MODULE) { + LCD_Brightness(7); + } else { + LCD_Brightness(g_setting.image.oled); + } LCD_ON(1); state = OLED_MD_DETECTING; cnt = 0;