* Reset sensor state before setting polarity
This commit is contained in:
iabdalkader 2014-03-03 16:03:12 +02:00
parent b410b5038c
commit 9e6524f70c
2 changed files with 3 additions and 3 deletions

View File

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