summaryrefslogtreecommitdiff
path: root/shared-bindings/microcontroller
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2020-11-23 22:44:53 -0500
committerDan Halbert <halbert@halwitz.org>2020-11-23 22:44:53 -0500
commit7a45afc54919162df342fab421ed113ff1771d01 (patch)
tree4d351d45751f40c096c89d0ea773a09a279d6b52 /shared-bindings/microcontroller
parent3abee9b2563f0203f3d9521631499008708bb407 (diff)
working, but need to avoid deep sleeping too fast before USB ready
Diffstat (limited to 'shared-bindings/microcontroller')
-rw-r--r--shared-bindings/microcontroller/__init__.c14
-rw-r--r--shared-bindings/microcontroller/__init__.h2
2 files changed, 1 insertions, 15 deletions
diff --git a/shared-bindings/microcontroller/__init__.c b/shared-bindings/microcontroller/__init__.c
index d6ce323c5..d09cf8f44 100644
--- a/shared-bindings/microcontroller/__init__.c
+++ b/shared-bindings/microcontroller/__init__.c
@@ -56,19 +56,6 @@
//| This object is the sole instance of `microcontroller.Processor`."""
//|
-//| def deep_sleep() -> None:
-//| Go into deep sleep. If the board is connected via USB, disconnect USB first.
-//|
-//| The board will awake from deep sleep only if the reset button is pressed
-//| or it is awoken by an alarm set by `alarm.set_deep_sleep_alarms()`.
-//| ...
-//|
-STATIC mp_obj_t mcu_deep_sleep(void){
-
- return mp_const_none;
-}
-MP_DEFINE_CONST_FUN_OBJ_0(mcu_deep_sleep_obj, mcu_deep_sleep);
-
//| def delay_us(delay: int) -> None:
//| """Dedicated delay method used for very short delays. **Do not** do long delays
//| because this stops all other functions from completing. Think of this as an empty
@@ -177,7 +164,6 @@ const mp_obj_module_t mcu_pin_module = {
STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_microcontroller) },
{ MP_ROM_QSTR(MP_QSTR_cpu), MP_ROM_PTR(&common_hal_mcu_processor_obj) },
- { MP_ROM_QSTR(MP_QSTR_deep_sleep), MP_ROM_PTR(&mcu_deep_sleep_obj) },
{ MP_ROM_QSTR(MP_QSTR_delay_us), MP_ROM_PTR(&mcu_delay_us_obj) },
{ MP_ROM_QSTR(MP_QSTR_disable_interrupts), MP_ROM_PTR(&mcu_disable_interrupts_obj) },
{ MP_ROM_QSTR(MP_QSTR_enable_interrupts), MP_ROM_PTR(&mcu_enable_interrupts_obj) },
diff --git a/shared-bindings/microcontroller/__init__.h b/shared-bindings/microcontroller/__init__.h
index c6ccccea7..87284fc2e 100644
--- a/shared-bindings/microcontroller/__init__.h
+++ b/shared-bindings/microcontroller/__init__.h
@@ -43,7 +43,7 @@ extern void common_hal_mcu_enable_interrupts(void);
extern void common_hal_mcu_on_next_reset(mcu_runmode_t runmode);
extern void common_hal_mcu_reset(void);
-extern void common_hal_mcu_deep_sleep(void);
+extern void NORETURN common_hal_mcu_deep_sleep(void);
extern const mp_obj_dict_t mcu_pin_globals;