mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #716 from kwagyeman/kwabena/rotation_integration
Auto rotation enabled
This commit is contained in:
commit
f58980fdc8
@ -70,6 +70,7 @@
|
|||||||
#include "py_lcd.h"
|
#include "py_lcd.h"
|
||||||
#include "py_fir.h"
|
#include "py_fir.h"
|
||||||
#include "py_tv.h"
|
#include "py_tv.h"
|
||||||
|
#include "py_imu.h"
|
||||||
|
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
|
|
||||||
@ -495,6 +496,9 @@ soft_reset:
|
|||||||
// mounting the file-system to log errors (if any).
|
// mounting the file-system to log errors (if any).
|
||||||
if (first_soft_reset) {
|
if (first_soft_reset) {
|
||||||
sensor_init_ret = sensor_init();
|
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();
|
mod_network_init();
|
||||||
|
|||||||
@ -275,4 +275,4 @@ float py_imu_pitch_rotation()
|
|||||||
|
|
||||||
return py_imu_get_pitch();
|
return py_imu_get_pitch();
|
||||||
}
|
}
|
||||||
#endif //MICROPY_PY_IMU
|
#endif // MICROPY_PY_IMU
|
||||||
|
|||||||
@ -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);
|
sensor_set_transpose(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //MICROPY_PY_IMU
|
#endif // MICROPY_PY_IMU
|
||||||
|
|
||||||
mp_obj_t image = py_image(0, 0, 0, 0);
|
mp_obj_t image = py_image(0, 0, 0, 0);
|
||||||
|
|
||||||
|
|||||||
@ -433,7 +433,11 @@ int sensor_reset()
|
|||||||
sensor.hmirror = false;
|
sensor.hmirror = false;
|
||||||
sensor.vflip = false;
|
sensor.vflip = false;
|
||||||
sensor.transpose = false;
|
sensor.transpose = false;
|
||||||
|
#if MICROPY_PY_IMU
|
||||||
|
sensor.auto_rotation = sensor.chip_id == OV7690_ID;
|
||||||
|
#else
|
||||||
sensor.auto_rotation = false;
|
sensor.auto_rotation = false;
|
||||||
|
#endif // MICROPY_PY_IMU
|
||||||
sensor.vsync_gpio = NULL;
|
sensor.vsync_gpio = NULL;
|
||||||
|
|
||||||
// Reset default color palette.
|
// Reset default color palette.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user