Skip to content

Make ResetReason and RunReason available #3797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions shared-bindings/alarm/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_light_sleep_until_alarms_obj, 1, MP_OB
//|
//| If no alarms are specified, the microcontroller will deep sleep until reset.
//|
//| **If CircuitPython is connected to a host computer, `alarm.exit_and_deep_sleep_until_alarms()`
//| then the connection will be maintained, and the system will not go into deep sleep.**
//| **If CircuitPython is connected to a host computer, the connection will be maintained,
//| and the system will not go into deep sleep.**
//| This allows the user to interrupt an existing program with ctrl-C,
//| and to edit the files in CIRCUITPY, which would not be possible in true deep sleep.
//| Thus, to use deep sleep and save significant power, you will need to disconnect from the host.
Expand Down
4 changes: 2 additions & 2 deletions shared-bindings/microcontroller/ResetReason.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ MAKE_ENUM_MAP(mcu_reset_reason) {
};
STATIC MP_DEFINE_CONST_DICT(mcu_reset_reason_locals_dict, mcu_reset_reason_locals_table);

MAKE_PRINTER(alarm, mcu_reset_reason);
MAKE_PRINTER(microcontroller, mcu_reset_reason);

MAKE_ENUM_TYPE(alarm, ResetReason, mcu_reset_reason);
MAKE_ENUM_TYPE(microcontroller, ResetReason, mcu_reset_reason);
1 change: 1 addition & 0 deletions shared-bindings/microcontroller/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ STATIC const mp_rom_map_elem_t mcu_module_globals_table[] = {
#else
{ MP_ROM_QSTR(MP_QSTR_watchdog), MP_ROM_PTR(&mp_const_none_obj) },
#endif
{ MP_ROM_QSTR(MP_QSTR_ResetReason), MP_ROM_PTR(&mcu_reset_reason_type) },
{ MP_ROM_QSTR(MP_QSTR_RunMode), MP_ROM_PTR(&mcu_runmode_type) },
{ MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&mcu_pin_type) },
{ MP_ROM_QSTR(MP_QSTR_pin), MP_ROM_PTR(&mcu_pin_module) },
Expand Down
1 change: 0 additions & 1 deletion shared-bindings/microcontroller/__init__.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/*
* This file is part of the MicroPython project, http://micropython.org/
*
Expand Down
1 change: 1 addition & 0 deletions shared-bindings/supervisor/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ STATIC const mp_rom_map_elem_t supervisor_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_set_rgb_status_brightness), MP_ROM_PTR(&supervisor_set_rgb_status_brightness_obj) },
{ MP_ROM_QSTR(MP_QSTR_runtime), MP_ROM_PTR(&common_hal_supervisor_runtime_obj) },
{ MP_ROM_QSTR(MP_QSTR_reload), MP_ROM_PTR(&supervisor_reload_obj) },
{ MP_ROM_QSTR(MP_QSTR_RunReason), MP_ROM_PTR(&supervisor_run_reason_type) },
{ MP_ROM_QSTR(MP_QSTR_set_next_stack_limit), MP_ROM_PTR(&supervisor_set_next_stack_limit_obj) },

};
Expand Down