From 728b1bcfd04984e35fe6b7dd015192c7a624e1ef Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Tue, 21 Nov 2023 19:19:58 +0800 Subject: [PATCH 1/2] stable osd warning show when bw will change --- src/camera.c | 34 +++++++++++++++++++++++----------- src/hardware.c | 4 ++-- src/hardware.h | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/camera.c b/src/camera.c index 8cf3eccb..2b0073f0 100644 --- a/src/camera.c +++ b/src/camera.c @@ -734,21 +734,22 @@ uint8_t camera_status_update(uint8_t op) { if (op == BTN_RIGHT) { camera_profile_eep = camera_profile_menu; - camera_profile_write(); - reset_isp_need |= camera_set(camera_setting_reg_menu, 1, 0); - camera_setting_reg_eep_update(); - camera_setting_profile_write(0xff); - if (reset_isp_need) { - if (camera_mfr == CAMERA_MFR_RUNCAM) { - runcam_reset_isp(); - camera_mode_detect(0); - } - } - if (RF_BW_check()) { + if (RF_BW_will_check()) { camera_menu_show_repower(); camMenuStatus = CAM_STATUS_REPOWER; } else { + camera_profile_write(); + reset_isp_need |= camera_set(camera_setting_reg_menu, 1, 0); + camera_setting_reg_eep_update(); + camera_setting_profile_write(0xff); + + if (reset_isp_need) { + if (camera_mfr == CAMERA_MFR_RUNCAM) { + runcam_reset_isp(); + camera_mode_detect(0); + } + } camera_menu_show_saving(); saving_start_sec = seconds; camMenuStatus = CAM_STATUS_SAVING; @@ -760,6 +761,17 @@ uint8_t camera_status_update(uint8_t op) { #ifdef _DEBUG_MODE debugf("\r\nRF_Delay_Init: None"); #endif + camera_profile_write(); + reset_isp_need |= camera_set(camera_setting_reg_menu, 1, 0); + camera_setting_reg_eep_update(); + camera_setting_profile_write(0xff); + if (reset_isp_need) { + if (camera_mfr == CAMERA_MFR_RUNCAM) { + runcam_reset_isp(); + camera_mode_detect(0); + } + } + if (PIT_MODE != PIT_OFF) { Init_6300RF(RF_FREQ, POWER_MAX + 1); vtx_pit = PIT_P1MW; diff --git a/src/hardware.c b/src/hardware.c index 77ff91cb..8ccf3b58 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -1488,9 +1488,9 @@ void LED_Task() { } } -uint8_t RF_BW_check(void) { +uint8_t RF_BW_will_check(void) { uint8_t ret = 0; - if (camera_type == CAMERA_TYPE_RUNCAM_NANO_90 && camera_setting_reg_set[11] == 2) + if (camera_type == CAMERA_TYPE_RUNCAM_NANO_90 && camera_setting_reg_menu[11] == 2) RF_BW = BW_17M; else RF_BW = BW_27M; diff --git a/src/hardware.h b/src/hardware.h index ae072fed..0caaf658 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -94,7 +94,7 @@ void Flicker_LED(uint8_t n); void LED_Flip(); void LED_Task(); -uint8_t RF_BW_check(void); +uint8_t RF_BW_will_check(void); void uart_baudrate_detect(void); uint8_t temperature_level(void); void vtx_paralized(void); From 5031425c724a320238c4faab14e14d19c42adb22 Mon Sep 17 00:00:00 2001 From: ligenxxxx <59721724+ligenxxxx@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:51:49 +0800 Subject: [PATCH 2/2] rename function --- src/camera.c | 2 +- src/hardware.c | 2 +- src/hardware.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/camera.c b/src/camera.c index 2b0073f0..f766e403 100644 --- a/src/camera.c +++ b/src/camera.c @@ -735,7 +735,7 @@ uint8_t camera_status_update(uint8_t op) { if (op == BTN_RIGHT) { camera_profile_eep = camera_profile_menu; - if (RF_BW_will_check()) { + if (RF_BW_to_be_changed()) { camera_menu_show_repower(); camMenuStatus = CAM_STATUS_REPOWER; } else { diff --git a/src/hardware.c b/src/hardware.c index 8ccf3b58..1f7af964 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -1488,7 +1488,7 @@ void LED_Task() { } } -uint8_t RF_BW_will_check(void) { +uint8_t RF_BW_to_be_changed(void) { uint8_t ret = 0; if (camera_type == CAMERA_TYPE_RUNCAM_NANO_90 && camera_setting_reg_menu[11] == 2) RF_BW = BW_17M; diff --git a/src/hardware.h b/src/hardware.h index 0caaf658..0763acbb 100644 --- a/src/hardware.h +++ b/src/hardware.h @@ -94,7 +94,7 @@ void Flicker_LED(uint8_t n); void LED_Flip(); void LED_Task(); -uint8_t RF_BW_will_check(void); +uint8_t RF_BW_to_be_changed(void); void uart_baudrate_detect(void); uint8_t temperature_level(void); void vtx_paralized(void);