diff --git a/pycardium/modules/ambient.c b/pycardium/modules/ambient.c index 5e9cf947fa7c7e5251468a4164254b03fb82057e..a66ee198a46e3d7365ade9e08c98a8174bbd0934 100644 --- a/pycardium/modules/ambient.c +++ b/pycardium/modules/ambient.c @@ -17,9 +17,17 @@ STATIC mp_obj_t mp_ambient_get_reading() } STATIC MP_DEFINE_CONST_FUN_OBJ_0(ambient_get_obj, mp_ambient_get_reading); +STATIC mp_obj_t mp_ambient_stop() +{ + epic_ambient_stop(); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_0(ambient_stop_obj, mp_ambient_stop); + STATIC const mp_rom_map_elem_t ambient_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_ambient) }, { MP_ROM_QSTR(MP_QSTR_start), MP_ROM_PTR(&ambient_start_obj) }, + { MP_ROM_QSTR(MP_QSTR_stop), MP_ROM_PTR(&ambient_stop_obj) }, { MP_ROM_QSTR(MP_QSTR_get_reading), MP_ROM_PTR(&ambient_get_obj) } }; STATIC MP_DEFINE_CONST_DICT(ambient_module_globals, ambient_module_globals_table); diff --git a/pycardium/modules/qstrdefs.h b/pycardium/modules/qstrdefs.h index 4ebd5d7c06290ba6b79e5148f74f6d1602fa9c70..76b63d8aacb47241ab12e7428913f7dbc7e48d9a 100644 --- a/pycardium/modules/qstrdefs.h +++ b/pycardium/modules/qstrdefs.h @@ -29,3 +29,4 @@ Q(vibrate) /* ambient */ Q(start) Q(get_reading) +Q(stop)