diff --git a/common/omv_csi.c b/common/omv_csi.c index a6c73dbbe..21492a57a 100644 --- a/common/omv_csi.c +++ b/common/omv_csi.c @@ -576,10 +576,15 @@ __weak int omv_csi_shutdown(omv_csi_t *csi, int enable) { } else { omv_gpio_write(OMV_CSI_POWER_PIN, 1); } + mp_hal_delay_ms(OMV_CSI_POWER_DELAY); } #endif - mp_hal_delay_ms(10); + // Call csi-specific shutdown function + if (csi->shutdown != NULL && + csi->shutdown(csi, enable) != 0) { + return OMV_CSI_ERROR_CTL_FAILED; + } return ret; } diff --git a/common/omv_csi.h b/common/omv_csi.h index 666f97c0a..4ff86e731 100644 --- a/common/omv_csi.h +++ b/common/omv_csi.h @@ -354,6 +354,7 @@ typedef struct _omv_csi { // Sensor function pointers int (*reset) (omv_csi_t *csi); int (*sleep) (omv_csi_t *csi, int enable); + int (*shutdown) (omv_csi_t *csi, int enable); int (*match) (omv_csi_t *csi, size_t id); int (*read_reg) (omv_csi_t *csi, uint16_t reg_addr); int (*write_reg) (omv_csi_t *csi, uint16_t reg_addr, uint16_t reg_data);