diff --git a/components/esp_driver_isp/include/esp_private/isp_private.h b/components/esp_driver_isp/include/esp_private/isp_private.h index 733a8ff671..76d6956a64 100644 --- a/components/esp_driver_isp/include/esp_private/isp_private.h +++ b/components/esp_driver_isp/include/esp_private/isp_private.h @@ -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 diff --git a/components/esp_driver_isp/src/isp_wbg.c b/components/esp_driver_isp/src/isp_wbg.c index b17d7d9ecc..851a746039 100644 --- a/components/esp_driver_isp/src/isp_wbg.c +++ b/components/esp_driver_isp/src/isp_wbg.c @@ -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; } diff --git a/examples/peripherals/isp/multi_pipelines/main/example_awb.c b/examples/peripherals/isp/multi_pipelines/main/example_awb.c index 9aae8083e1..df09cabbc6 100644 --- a/examples/peripherals/isp/multi_pipelines/main/example_awb.c +++ b/examples/peripherals/isp/multi_pipelines/main/example_awb.c @@ -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);