mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Fix bug
* Reset sensor state before setting polarity
This commit is contained in:
parent
b410b5038c
commit
9e6524f70c
@ -362,6 +362,9 @@ int sensor_init()
|
||||
extclk_config(24000000);
|
||||
systick_sleep(10);
|
||||
|
||||
/* Reset the sesnor state */
|
||||
memset(&sensor, 0, sizeof(struct sensor_dev));
|
||||
|
||||
/* Some sensors have different reset polarities, and we can't know which sensor
|
||||
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
|
||||
@ -379,9 +382,6 @@ int sensor_init()
|
||||
systick_sleep(10);
|
||||
}
|
||||
|
||||
/* Reset the sesnor state */
|
||||
bzero(&sensor, sizeof(struct sensor_dev));
|
||||
|
||||
/* Read the sensor information */
|
||||
sensor.id.MIDH = SCCB_Read(REG_MIDH);
|
||||
sensor.id.MIDL = SCCB_Read(REG_MIDL);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user