mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix sensor reset code
This commit is contained in:
parent
5f2b17f62c
commit
48b73580b0
11
src/sensor.c
11
src/sensor.c
@ -369,17 +369,24 @@ int sensor_init()
|
||||
is connected before initializing SCCB and reading the PID register, which in
|
||||
turn requires pulling the sensor out of the reset state. So we try to read a
|
||||
register with both polarities to determine line state. */
|
||||
sensor.reset_pol = ACTIVE_HIGH;
|
||||
|
||||
sensor.reset_pol = ACTIVE_LOW;
|
||||
GPIO_SetBits(GPIOA, GPIO_Pin_10);
|
||||
systick_sleep(10);
|
||||
|
||||
GPIO_ResetBits(GPIOA, GPIO_Pin_10);
|
||||
systick_sleep(10);
|
||||
|
||||
/* Check if we can read PID */
|
||||
if (SCCB_Read(REG_PID) == 255) {
|
||||
/* Sensor is held in reset, so reset is active high */
|
||||
sensor.reset_pol = ACTIVE_HIGH;
|
||||
sensor.reset_pol = ACTIVE_LOW;
|
||||
|
||||
GPIO_ResetBits(GPIOA, GPIO_Pin_10);
|
||||
systick_sleep(10);
|
||||
|
||||
GPIO_SetBits(GPIOA, GPIO_Pin_10);
|
||||
systick_sleep(10);
|
||||
}
|
||||
|
||||
/* Read the sensor information */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user