mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #1420 from openmv/py_sensor_reset
Use sensor_strerror for sensor_reset error.
This commit is contained in:
commit
f1021d9e26
@ -74,7 +74,10 @@ static mp_obj_t py_sensor__init__()
|
||||
|
||||
static mp_obj_t py_sensor_reset()
|
||||
{
|
||||
PY_ASSERT_FALSE_MSG(sensor_reset() != 0, "Reset Failed");
|
||||
int ret = sensor_reset();
|
||||
if (ret != 0) {
|
||||
mp_raise_msg(&mp_type_RuntimeError, sensor_strerror(ret));
|
||||
}
|
||||
#if MICROPY_PY_IMU
|
||||
// +-10 degree dead-zone around pitch 90/270.
|
||||
// +-45 degree active-zone around roll 0/90/180/270/360.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user