mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
fix(isp): fixed wbg shadow not working issue
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user