diff --git a/src/omv/ports/nrf/sensor.c b/src/omv/ports/nrf/sensor.c index 367a7f6b8..aa11e9ea7 100644 --- a/src/omv/ports/nrf/sensor.c +++ b/src/omv/ports/nrf/sensor.c @@ -144,14 +144,6 @@ static int dcmi_config() _hrefPort = portInputRegister(digitalPinToPort(DCMI_HSYNC_PIN)); _pclkPort = portInputRegister(digitalPinToPort(DCMI_PXCLK_PIN)); - #if defined(DCMI_PWDN_PIN) - nrf_gpio_cfg_output(DCMI_PWDN_PIN); - #endif - - #if defined(DCMI_RESET_PIN) - nrf_gpio_cfg_output(DCMI_RESET_PIN); - #endif - return 0; } @@ -159,6 +151,16 @@ int sensor_init() { int init_ret = 0; + #if defined(DCMI_PWDN_PIN) + nrf_gpio_cfg_output(DCMI_PWDN_PIN); + DCMI_PWDN_HIGH(); + #endif + + #if defined(DCMI_RESET_PIN) + nrf_gpio_cfg_output(DCMI_RESET_PIN); + DCMI_RESET_HIGH(); + #endif + /* Do a power cycle */ DCMI_PWDN_HIGH(); mp_hal_delay_ms(10);