NANO: Configure PDWN and RST in sensor_init

This commit is contained in:
iabdalkader 2021-02-25 23:49:57 +02:00
parent d4859f58a8
commit eba6ad937d

View File

@ -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);