Merge pull request #893 from openmv/sensor_reset

Do hard-reset in sensor.reset().
This commit is contained in:
Ibrahim Abd Elkader 2020-09-04 22:18:17 +02:00 committed by GitHub
commit ac653ed36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -500,6 +500,18 @@ int sensor_reset()
// Restore shutdown state on reset. // Restore shutdown state on reset.
sensor_shutdown(false); sensor_shutdown(false);
// Hard-reset the sensor
if (sensor.reset_pol == ACTIVE_HIGH) {
DCMI_RESET_HIGH();
systick_sleep(10);
DCMI_RESET_LOW();
} else {
DCMI_RESET_LOW();
systick_sleep(10);
DCMI_RESET_HIGH();
}
systick_sleep(20);
// Call sensor-specific reset function // Call sensor-specific reset function
if (sensor.reset(&sensor) != 0) { if (sensor.reset(&sensor) != 0) {
return -1; return -1;