From eba6ad937d2cd5e9ca44e9558305c36166f40bb6 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 25 Feb 2021 23:49:57 +0200 Subject: [PATCH] NANO: Configure PDWN and RST in sensor_init --- src/omv/ports/nrf/sensor.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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);