Skip to content

Commit

Permalink
Merge pull request #177 from ligenxxxx/fix-unstable-osd-warning-show-…
Browse files Browse the repository at this point in the history
…when-bw-will-be-changed

stable osd warning show when BW is changed
  • Loading branch information
ligenxxxx authored Nov 29, 2023
2 parents eee6fb4 + 5031425 commit 554dad1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
34 changes: 23 additions & 11 deletions src/camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_to_be_changed()) {
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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/hardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,9 +1488,9 @@ void LED_Task() {
}
}

uint8_t RF_BW_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_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;
Expand Down
2 changes: 1 addition & 1 deletion src/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_to_be_changed(void);
void uart_baudrate_detect(void);
uint8_t temperature_level(void);
void vtx_paralized(void);
Expand Down

0 comments on commit 554dad1

Please sign in to comment.