fix(isp): fixed wbg shadow not working issue

This commit is contained in:
armando
2026-01-20 16:59:17 +08:00
parent 85b5688241
commit 4e8231f733
3 changed files with 14 additions and 1 deletions
@@ -104,6 +104,10 @@ typedef struct isp_processor_t {
uint32_t hist_isr_added: 1;
} isr_users;
struct {
uint32_t wbg_update_once_configured: 1;
} sub_module_flags;
} isp_processor_t;
#endif
+5
View File
@@ -40,6 +40,8 @@ esp_err_t esp_isp_wbg_configure(isp_proc_handle_t isp_proc, const esp_isp_wbg_co
bool valid = isp_ll_shadow_update_wbg(isp_proc->hal.hw, config->flags.update_once_configured);
ESP_RETURN_ON_FALSE_ISR(valid, ESP_ERR_INVALID_STATE, TAG, "failed to update wbg shadow register");
isp_proc->sub_module_flags.wbg_update_once_configured = config->flags.update_once_configured;
return ESP_OK;
}
@@ -64,6 +66,9 @@ esp_err_t esp_isp_wbg_set_wb_gain(isp_proc_handle_t isp_proc, isp_wbg_gain_t gai
// Set WBG gain
isp_ll_awb_set_wb_gain(isp_proc->hal.hw, gain);
bool valid = isp_ll_shadow_update_wbg(isp_proc->hal.hw, isp_proc->sub_module_flags.wbg_update_once_configured);
ESP_RETURN_ON_FALSE_ISR(valid, ESP_ERR_INVALID_STATE, TAG, "failed to update wbg shadow register");
return ESP_OK;
}
@@ -260,7 +260,11 @@ esp_err_t example_isp_awb_init(isp_proc_handle_t isp_proc)
}
// Configure WBG module
esp_isp_wbg_config_t wbg_config = {};
esp_isp_wbg_config_t wbg_config = {
.flags = {
.update_once_configured = true,
},
};
ret = esp_isp_wbg_configure(isp_proc, &wbg_config);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to configure WBG: %d", ret);