Merge pull request #716 from kwagyeman/kwabena/rotation_integration

Auto rotation enabled
This commit is contained in:
Ibrahim Abd Elkader 2020-02-14 18:17:20 +02:00 committed by GitHub
commit f58980fdc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View File

@ -70,6 +70,7 @@
#include "py_lcd.h"
#include "py_fir.h"
#include "py_tv.h"
#include "py_imu.h"
#include "framebuffer.h"
@ -495,6 +496,9 @@ soft_reset:
// mounting the file-system to log errors (if any).
if (first_soft_reset) {
sensor_init_ret = sensor_init();
#if MICROPY_PY_IMU
if ((!sensor_init_ret) && (sensor_get_id() == OV7690_ID)) py_imu_init();
#endif // MICROPY_PY_IMU
}
mod_network_init();

View File

@ -275,4 +275,4 @@ float py_imu_pitch_rotation()
return py_imu_get_pitch();
}
#endif //MICROPY_PY_IMU
#endif // MICROPY_PY_IMU

View File

@ -70,7 +70,7 @@ static mp_obj_t py_sensor_snapshot(uint n_args, const mp_obj_t *args, mp_map_t *
sensor_set_transpose(true);
}
}
#endif //MICROPY_PY_IMU
#endif // MICROPY_PY_IMU
mp_obj_t image = py_image(0, 0, 0, 0);

View File

@ -433,7 +433,11 @@ int sensor_reset()
sensor.hmirror = false;
sensor.vflip = false;
sensor.transpose = false;
#if MICROPY_PY_IMU
sensor.auto_rotation = sensor.chip_id == OV7690_ID;
#else
sensor.auto_rotation = false;
#endif // MICROPY_PY_IMU
sensor.vsync_gpio = NULL;
// Reset default color palette.