mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Update error handling code for sensor.reset() and sensor.sleep().
This commit is contained in:
parent
6daabb3a52
commit
7d16d008f9
@ -22,15 +22,13 @@
|
|||||||
extern sensor_t sensor;
|
extern sensor_t sensor;
|
||||||
|
|
||||||
static mp_obj_t py_sensor_reset() {
|
static mp_obj_t py_sensor_reset() {
|
||||||
sensor_reset();
|
PY_ASSERT_FALSE_MSG(sensor_reset() != 0, "Reset Failed");
|
||||||
return mp_const_none;
|
return mp_const_none;
|
||||||
}
|
}
|
||||||
|
|
||||||
static mp_obj_t py_sensor_sleep(mp_obj_t enable) {
|
static mp_obj_t py_sensor_sleep(mp_obj_t enable) {
|
||||||
if (sensor_sleep(mp_obj_is_true(enable)) != 0) {
|
PY_ASSERT_FALSE_MSG(sensor_sleep(mp_obj_is_true(enable)) != 0, "Sleep Failed");
|
||||||
return mp_const_false;
|
return mp_const_none;
|
||||||
}
|
|
||||||
return mp_const_true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static mp_obj_t py_sensor_flush() {
|
static mp_obj_t py_sensor_flush() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user