Skip to content

Commit 054eafd

Browse files
authored
Merge pull request #3797 from dhalbert/reset-reason-run-reason-available
Make ResetReason and RunReason available
2 parents 22ad76b + 9391c8f commit 054eafd

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

shared-bindings/alarm/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_light_sleep_until_alarms_obj, 1, MP_OB
125125
//|
126126
//| If no alarms are specified, the microcontroller will deep sleep until reset.
127127
//|
128-
//| **If CircuitPython is connected to a host computer, `alarm.exit_and_deep_sleep_until_alarms()`
129-
//| then the connection will be maintained, and the system will not go into deep sleep.**
128+
//| **If CircuitPython is connected to a host computer, the connection will be maintained,
129+
//| and the system will not go into deep sleep.**
130130
//| This allows the user to interrupt an existing program with ctrl-C,
131131
//| and to edit the files in CIRCUITPY, which would not be possible in true deep sleep.
132132
//| Thus, to use deep sleep and save significant power, you will need to disconnect from the host.

shared-bindings/microcontroller/ResetReason.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,6 @@ MAKE_ENUM_MAP(mcu_reset_reason) {
7272
};
7373
STATIC MP_DEFINE_CONST_DICT(mcu_reset_reason_locals_dict, mcu_reset_reason_locals_table);
7474

75-
MAKE_PRINTER(alarm, mcu_reset_reason);
75+
MAKE_PRINTER(microcontroller, mcu_reset_reason);
7676

77-
MAKE_ENUM_TYPE(alarm, ResetReason, mcu_reset_reason);
77+
MAKE_ENUM_TYPE(microcontroller, ResetReason, mcu_reset_reason);

shared-bindings/microcontroller/__init__.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = {
170170
#else
171171
{ MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) },
172172
#endif
173+
{ MP_ROM_QSTR(MP_QSTR_ResetReason), MP_ROM_PTR(&mcu_reset_reason_type) },
173174
{ MP_ROM_QSTR(MP_QSTR_RunMode), MP_ROM_PTR(&mcu_runmode_type) },
174175
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&mcu_pin_type) },
175176
{ MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&mcu_pin_module) },

shared-bindings/microcontroller/__init__.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* This file is part of the MicroPython project, http://micropython.org/
43
*

shared-bindings/supervisor/__init__.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = {
119119
{ MP_ROM_QSTR(MP_QSTR_set_rgb_status_brightness), MP_ROM_PTR(&supervisor_set_rgb_status_brightness_obj) },
120120
{ MP_ROM_QSTR(MP_QSTR_runtime), MP_ROM_PTR(&common_hal_supervisor_runtime_obj) },
121121
{ MP_ROM_QSTR(MP_QSTR_reload), MP_ROM_PTR(&supervisor_reload_obj) },
122+
{ MP_ROM_QSTR(MP_QSTR_RunReason), MP_ROM_PTR(&supervisor_run_reason_type) },
122123
{ MP_ROM_QSTR(MP_QSTR_set_next_stack_limit), MP_ROM_PTR(&supervisor_set_next_stack_limit_obj) },
123124

124125
};

0 commit comments

Comments
 (0)