Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
b637d39
Initial commit
gamblor21 Oct 25, 2020
12d770b
Added __probe_for_device
gamblor21 Oct 25, 2020
8a37983
Added doc and translations
gamblor21 Oct 26, 2020
9ec2245
Clean up
gamblor21 Oct 27, 2020
2374b0d
Fixed whitespace issues
gamblor21 Oct 27, 2020
90b9ec6
Initial Sleep Support
microdev1 Sep 18, 2020
3a30887
Update soft reboot message
microdev1 Sep 18, 2020
e310b87
Get io wake working
microdev1 Sep 19, 2020
05a3f20
Add function to get time elapsed during sleep
microdev1 Sep 22, 2020
21ba61a
Add function to disable alarm
microdev1 Sep 22, 2020
e5ff55b
Renamed alarm modules
microdev1 Sep 23, 2020
4d8ffdc
restructure alarm modules
microdev1 Sep 24, 2020
da44972
Fix build error
microdev1 Sep 24, 2020
59df1a1
Add alarm_touch module
microdev1 Sep 24, 2020
e359389
Add description of alarm modules
microdev1 Sep 24, 2020
930cf14
Add check for invalid io, function to disable all alarms
microdev1 Sep 26, 2020
0e444f0
Implement sleep on code.py exit
microdev1 Sep 30, 2020
354536c
Update translation
microdev1 Oct 7, 2020
1196d4b
move to new module
tannewt Oct 14, 2020
85dadf3
More API changes
tannewt Oct 15, 2020
9a4efed
Start tweaking the workflow to sleep
tannewt Oct 28, 2020
e7da852
Fixing review comments
gamblor21 Oct 29, 2020
78477a3
Initial SPI commit
gamblor21 Oct 31, 2020
5ea09fe
Fixed stubs
gamblor21 Oct 31, 2020
76c1153
Fixed stubs
gamblor21 Nov 1, 2020
7dd5380
Fixed stubs again
gamblor21 Nov 1, 2020
8bbbb28
Fixes from testing SPI
gamblor21 Nov 2, 2020
197539b
Moved I2CDevice and SPI to match python library
gamblor21 Nov 3, 2020
4c93db3
Renamed to adafruit_bus_device
gamblor21 Nov 4, 2020
03b110b
Add abort check in I2C lock
gamblor21 Nov 11, 2020
f61c4e6
Removing from smaller builds
gamblor21 Nov 11, 2020
23ed3ef
Removing frozen libs
gamblor21 Nov 11, 2020
bb77f1d
wip: initial code changes, starting from @tannewt's sleepio branch
dhalbert Nov 16, 2020
ffff02c
Merge remote-tracking branch 'adafruit/main' into sleep
dhalbert Nov 16, 2020
682054a
WIP: redo API; not compiled yet
dhalbert Nov 19, 2020
5bb3c32
merge from main
dhalbert Nov 19, 2020
649c930
wip
dhalbert Nov 19, 2020
cd436ba
Merge remote-tracking branch 'adafruit/main' into sleep
dhalbert Nov 19, 2020
39e1f52
wip; not compiling yet
dhalbert Nov 19, 2020
e4c6699
compiles
dhalbert Nov 21, 2020
75559f3
wip: ResetReason to microcontroller.cpu
dhalbert Nov 22, 2020
a0f1ec3
wip
dhalbert Nov 23, 2020
25591a3
Merge branch 'esp32s2-common-hal-mcu-delay-us' into sleep
dhalbert Nov 23, 2020
3abee9b
compiles; maybe ready to test, or almost
dhalbert Nov 23, 2020
7a45afc
working, but need to avoid deep sleeping too fast before USB ready
dhalbert Nov 24, 2020
f868cc5
some API renaming and bug fixes; fix docs
dhalbert Nov 25, 2020
9dbea36
changed alarm.time API
dhalbert Nov 25, 2020
ef0830b
merge from upstream + wip
dhalbert Nov 25, 2020
104a089
deep sleep working; deep sleep delay when connected
dhalbert Nov 27, 2020
e308a9e
working! PinAlarm not implemented yet.
dhalbert Nov 27, 2020
596e0e4
merge from upstream
dhalbert Nov 27, 2020
f96475c
update Requests; rolled back by accident
dhalbert Nov 27, 2020
65e2fe4
fix stub problems; touch up doc
dhalbert Nov 28, 2020
2830cc9
make translate
dhalbert Nov 28, 2020
28d9e91
Disable complex arithmetic on SAMD21 builds to make space
dhalbert Nov 28, 2020
4ac4faa
Use nina-fw root certs
tannewt Dec 1, 2020
9276244
Two minor socket changes
tannewt Dec 1, 2020
9a9e972
Ignore certificates readme in doc build
tannewt Dec 1, 2020
a95285a
Translated using Weblate (Polish)
szajakubiak Dec 1, 2020
f6cba4c
Translated using Weblate (Polish)
tawez Dec 1, 2020
44e0d98
Translated using Weblate (Polish)
szajakubiak Dec 1, 2020
2b9ca4d
Translated using Weblate (Polish)
tawez Dec 1, 2020
2373857
Merge branch 'main' into bus_device
gamblor21 Dec 1, 2020
d3bbb99
Fixing stubs
gamblor21 Dec 1, 2020
8b7c23c
address review comments
dhalbert Dec 2, 2020
fe1c2fa
Removed bus device from simmel build
gamblor21 Dec 2, 2020
72fa7d8
fix doc errors
dhalbert Dec 2, 2020
73e22f9
Block all tasks (not interrupts) during flash erase
tannewt Dec 2, 2020
cb863e4
Added to partial builds where frozen removed
gamblor21 Dec 2, 2020
1c00deb
Translated using Weblate (Polish)
tawez Dec 1, 2020
9e6b2b1
Translated using Weblate (Czech)
vkuthan Dec 1, 2020
d7ba641
Merge pull request #3767 from dhalbert/sleep
tannewt Dec 2, 2020
8f6baa2
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
7655102
Update translation files
weblate Dec 2, 2020
31acfed
Merge pull request #3780 from tannewt/block_while_erasing
dhalbert Dec 2, 2020
51fd678
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
9b3186b
Merge pull request #3776 from tannewt/backup_socket_timeout
dhalbert Dec 2, 2020
c7749a5
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
348392f
Merge pull request #3775 from tannewt/nina_certs
dhalbert Dec 2, 2020
a483cd1
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
1130b80
Merge pull request #3612 from gamblor21/bus_device
tannewt Dec 2, 2020
079bf7a
Merge branch 'origin/main' into Weblate.
weblate Dec 2, 2020
03d0ec8
Update translation files
weblate Dec 2, 2020
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
Prev Previous commit
Next Next commit
merge from upstream + wip
  • Loading branch information
dhalbert committed Nov 25, 2020
commit ef0830bfe241b544b05bd3081f5bba03af57fe0d
4 changes: 4 additions & 0 deletions locale/circuitpython.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
<<<<<<< HEAD
"POT-Creation-Date: 2020-11-25 15:08-0500\n"
=======
"POT-Creation-Date: 2020-11-11 16:30+0530\n"
>>>>>>> adafruit/main
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
56 changes: 28 additions & 28 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@

#include "boards/board.h"

// REMOVE ***********
#include "esp_log.h"

#if CIRCUITPY_ALARM
Expand Down Expand Up @@ -97,8 +98,8 @@
#include "common-hal/canio/CAN.h"
#endif

// How long to wait for host to enumerate (secs).
#define CIRCUITPY_USB_ENUMERATION_DELAY 5
// How long to wait for host to start connecting..
#define CIRCUITPY_USB_CONNECTING_DELAY 1

// How long to flash errors on the RGB status LED before going to sleep (secs)
#define CIRCUITPY_FLASH_ERROR_PERIOD 10
Expand Down Expand Up @@ -258,6 +259,17 @@ STATIC void print_code_py_status_message(safe_mode_t safe_mode) {
}
}

// Should we go into deep sleep when program finishes?
// Normally we won't deep sleep if there was an error or if we are connected to a host
// but either of those can be enabled.
// It's ok to deep sleep if we're not connected to a host, but we need to make sure
// we're giving enough time for USB to start to connect
STATIC bool deep_sleep_allowed(void) {
return
(ok || supervisor_workflow_get_allow_deep_sleep_on_error()) &&
!supervisor_workflow_connecting()
(supervisor_ticks_ms64() > CIRCUITPY_USB_CONNECTING_DELAY * 1024);

STATIC bool run_code_py(safe_mode_t safe_mode) {
bool serial_connected_at_start = serial_connected();
#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0
Expand Down Expand Up @@ -307,7 +319,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
// Program has finished running.

// Display a different completion message if the user has no USB attached (cannot save files)
if (!serial_connected_at_start) {
if (!serial_connected_at_start && !deep_sleep_allowed()) {
serial_write_compressed(translate("\nCode done running. Waiting for reload.\n"));
}

Expand All @@ -318,32 +330,16 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
rgb_status_animation_t animation;
bool ok = result.return_code != PYEXEC_EXCEPTION;

ESP_LOGI("main", "common_hal_alarm_enable_deep_sleep_alarms()");
#if CIRCUITPY_ALARM
// Enable pin or time alarms before sleeping.
// If immediate_wake is true, then there's alarm that would trigger immediately,
// If immediate_wake is true, then there's an alarm that would trigger immediately,
// so don't sleep.
bool immediate_wake = !common_hal_alarm_enable_deep_sleep_alarms();
#endif


prep_rgb_status_animation(&result, found_main, safe_mode, &animation);
while (true) {
// Normally we won't deep sleep if there was an error or if we are connected to a host
// but either of those can be enabled.
// It's ok to deep sleep if we're not connected to a host, but we need to make sure
// we're giving enough time for USB enumeration to happen.
bool deep_sleep_allowed =
!immediate_wake &&
(ok || supervisor_workflow_get_allow_deep_sleep_on_error()) &&
(!supervisor_workflow_active() || supervisor_workflow_get_allow_deep_sleep_when_connected()) &&
(supervisor_ticks_ms64() > CIRCUITPY_USB_ENUMERATION_DELAY * 1024);

ESP_LOGI("main", "ok %d", deep_sleep_allowed);
ESP_LOGI("main", "...on_error() %d", supervisor_workflow_get_allow_deep_sleep_on_error());
ESP_LOGI("main", "supervisor_workflow_active() %d", supervisor_workflow_active());
ESP_LOGI("main", "...when_connected() %d", supervisor_workflow_get_allow_deep_sleep_when_connected());
ESP_LOGI("main", "supervisor_ticks_ms64() %lld", supervisor_ticks_ms64());

RUN_BACKGROUND_TASKS;
if (reload_requested) {
supervisor_set_run_reason(RUN_REASON_AUTO_RELOAD);
Expand All @@ -365,7 +361,7 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
print_code_py_status_message(safe_mode);
}
// We won't be going into the REPL if we're going to sleep.
if (!deep_sleep_allowed) {
if (!deep_sleep_allowed()) {
print_safe_mode_message(safe_mode);
serial_write("\n");
serial_write_compressed(translate("Press any key to enter the REPL. Use CTRL-D to reload."));
Expand All @@ -385,15 +381,19 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {

bool animation_done = false;

if (deep_sleep_allowed && ok) {
if (deep_sleep_allowed() && ok) {
// Skip animation if everything is OK.
animation_done = true;
} else {
animation_done = tick_rgb_status_animation(&animation);
}
// Do an error animation only once before deep-sleeping.
if (animation_done) {
if (deep_sleep_allowed) {
if (immediate_wake) {
// Don't sleep, we are already supposed to wake up.
return true;
}
if (deep_sleep_allowed()) {
common_hal_mcu_deep_sleep();
// Does not return.
}
Expand All @@ -402,10 +402,10 @@ STATIC bool run_code_py(safe_mode_t safe_mode) {
if (!ok) {
port_interrupt_after_ticks(CIRCUITPY_FLASH_ERROR_PERIOD * 1024);
} else {
int64_t remaining_enumeration_wait =
CIRCUITPY_USB_ENUMERATION_DELAY * 1024 - supervisor_ticks_ms64();
if (remaining_enumeration_wait > 0) {
port_interrupt_after_ticks(remaining_enumeration_wait);
int64_t remaining_connecting_wait =
CIRCUITPY_USB_CONNECTING_DELAY * 1024 - supervisor_ticks_ms64();
if (remaining_connecting_wait > 0) {
port_interrupt_after_ticks(remaining_connecting_wait);
}
port_sleep_until_interrupt();
}
Expand Down
23 changes: 12 additions & 11 deletions ports/esp32s2/common-hal/alarm/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@

#include "shared-bindings/alarm/__init__.h"
#include "shared-bindings/alarm/pin/PinAlarm.h"
#include "shared-bindings/alarm/time/MonotonicTimeAlarm.h"
#include "shared-bindings/alarm/time/TimeAlarm.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/time/__init__.h"

#include "esp_log.h"
#include "esp_sleep.h"

STATIC mp_obj_tuple_t *_deep_sleep_alarms;
Expand All @@ -51,8 +52,8 @@ mp_obj_t common_hal_alarm_get_wake_alarm(void) {
switch (esp_sleep_get_wakeup_cause()) {
case ESP_SLEEP_WAKEUP_TIMER: {
// Wake up from timer.
alarm_time_monotonic_time_alarm_obj_t *timer = m_new_obj(alarm_time_monotonic_time_alarm_obj_t);
timer->base.type = &alarm_time_monotonic_time_alarm_type;
alarm_time_time_alarm_obj_t *timer = m_new_obj(alarm_time_time_alarm_obj_t);
timer->base.type = &alarm_time_time_alarm_type;
return timer;
}

Expand Down Expand Up @@ -86,7 +87,7 @@ void common_hal_alarm_set_deep_sleep_alarms(size_t n_alarms, const mp_obj_t *ala
if (MP_OBJ_IS_TYPE(alarms[i], &alarm_pin_pin_alarm_type)) {
mp_raise_NotImplementedError(translate("PinAlarm deep sleep not yet implemented"));
}
else if (MP_OBJ_IS_TYPE(alarms[i], &alarm_time_monotonic_time_alarm_type)) {
else if (MP_OBJ_IS_TYPE(alarms[i], &alarm_time_time_alarm_type)) {
if (time_alarm_set) {
mp_raise_ValueError(translate("Only one alarm.time alarm can be set."));
}
Expand All @@ -106,15 +107,15 @@ bool common_hal_alarm_enable_deep_sleep_alarms(void) {
// TODO: handle pin alarms
mp_raise_NotImplementedError(translate("PinAlarm deep sleep not yet implemented"));
}
else if (MP_OBJ_IS_TYPE(alarm, &alarm_time_monotonic_time_alarm_type)) {
alarm_time_monotonic_time_alarm_obj_t *monotonic_time_alarm = MP_OBJ_TO_PTR(alarm);
mp_float_t now = uint64_to_float(common_hal_time_monotonic());
// Compute a relative time in the future from now.
mp_float_t duration_secs = now - monotonic_time_alarm->monotonic_time;
if (duration_secs <= 0.0f) {
else if (MP_OBJ_IS_TYPE(alarm, &alarm_time_time_alarm_type)) {
alarm_time_time_alarm_obj_t *time_alarm = MP_OBJ_TO_PTR(alarm);
mp_float_t now_secs = uint64_to_float(common_hal_time_monotonic_ms()) / 1000.0f;
// Compute how long to actually sleep, considering hte time now.
mp_float_t wakeup_in_secs = time_alarm->monotonic_time - now_secs;
if (wakeup_in_secs <= 0.0f) {
return false;
}
esp_sleep_enable_timer_wakeup((uint64_t) (duration_secs * 1000000));
esp_sleep_enable_timer_wakeup((uint64_t) (wakeup_in_secs * 1000000));
}
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

#include "py/runtime.h"

#include "shared-bindings/alarm/time/MonotonicTimeAlarm.h"
#include "shared-bindings/alarm/time/TimeAlarm.h"

void common_hal_alarm_time_monotonic_time_alarm_construct(alarm_time_monotonic_time_alarm_obj_t *self, mp_float_t monotonic_time) {
void common_hal_alarm_time_time_alarm_construct(alarm_time_time_alarm_obj_t *self, mp_float_t monotonic_time) {
self->monotonic_time = monotonic_time;
}

mp_float_t common_hal_alarm_time_monotonic_time_alarm_get_monotonic_time(alarm_time_monotonic_time_alarm_obj_t *self) {
mp_float_t common_hal_alarm_time_time_alarm_get_monotonic_time(alarm_time_time_alarm_obj_t *self) {
return self->monotonic_time;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
typedef struct {
mp_obj_base_t base;
mp_float_t monotonic_time; // values compatible with time.monotonic_time()
} alarm_time_monotonic_time_alarm_obj_t;
} alarm_time_time_alarm_obj_t;
2 changes: 1 addition & 1 deletion ports/esp32s2/common-hal/time/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "tick.h"

uint64_t common_hal_time_monotonic(void) {
uint64_t common_hal_time_monotonic_ms(void) {
return supervisor_ticks_ms64();
}

Expand Down
3 changes: 1 addition & 2 deletions ports/esp32s2/mpconfigport.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ CIRCUITPY_COUNTIO = 1
CIRCUITPY_FREQUENCYIO = 1
CIRCUITPY_I2CPERIPHERAL = 0
CIRCUITPY_ROTARYIO = 1
CIRCUITPY_NVM = 0

CIRCUITPY_NVM = 1
# We don't have enough endpoints to include MIDI.
CIRCUITPY_USB_MIDI = 0
CIRCUITPY_WIFI = 1
Expand Down
2 changes: 1 addition & 1 deletion ports/litex/common-hal/time/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "tick.h"

uint64_t common_hal_time_monotonic(void) {
uint64_t common_hal_time_monotonic_ms(void) {
return supervisor_ticks_ms64();
}

Expand Down
2 changes: 1 addition & 1 deletion py/circuitpy_defns.mk
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ SRC_COMMON_HAL_ALL = \
_pew/__init__.c \
alarm/__init__.c \
alarm/pin/PinAlarm.c \
alarm/time/MonotonicTimeAlarm.c \
alarm/time/TimeAlarm.c \
analogio/AnalogIn.c \
analogio/AnalogOut.c \
analogio/__init__.c \
Expand Down
38 changes: 18 additions & 20 deletions shared-bindings/alarm/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "shared-bindings/alarm/__init__.h"
#include "shared-bindings/alarm/pin/PinAlarm.h"
#include "shared-bindings/alarm/time/MonotonicTimeAlarm.h"
#include "shared-bindings/alarm/time/TimeAlarm.h"

//| """Power-saving light and deep sleep. Alarms can be set to wake up from sleep.
//|
Expand All @@ -42,12 +42,9 @@
//| peripherals, such as I2C, are left on.
//|
//| Deep sleep shuts down power to nearly all of the chip including the CPU and RAM. This can save
//| a more significant amount of power, but CircuitPython must start ``code.py`` from the beginning when woken
//| up. If the board is not actively connected to a host computer (usually via USB),
//| CircuitPython will enter deep sleep automatically when the current program finishes its last statement
//| or calls ``sys.exit()``.
//| If the board is connected, the board will not enter deep sleep unless `supervisor.exit_and_deep_sleep()`
//| is called explicitly.
//| a more significant amount of power, but CircuitPython must start ``code.py`` from the beginning when
//| awakened.

//|
//| An error includes an uncaught exception, or sys.exit() called with a non-zero argument
//|
Expand All @@ -60,16 +57,16 @@
void validate_objs_are_alarms(size_t n_args, const mp_obj_t *objs) {
for (size_t i = 0; i < n_args; i++) {
if (MP_OBJ_IS_TYPE(objs[i], &alarm_pin_pin_alarm_type) ||
MP_OBJ_IS_TYPE(objs[i], &alarm_time_monotonic_time_alarm_type)) {
MP_OBJ_IS_TYPE(objs[i], &alarm_time_time_alarm_type)) {
continue;
}
mp_raise_TypeError_varg(translate("Expected an alarm"));
}
}

//| def sleep_until_alarms(*alarms: Alarm) -> Alarm:
//| """Performs a light sleep until woken by one of the alarms. The alarm caused the wake-up
//| is returned, and is also available as `alarm.wake_alarm`
//| """Go into a light sleep until awakened one of the alarms. The alarm causing the wake-up
//| is returned, and is also available as `alarm.wake_alarm`.
//| """
//| ...
//|
Expand All @@ -80,26 +77,26 @@ STATIC mp_obj_t alarm_sleep_until_alarms(size_t n_args, const mp_obj_t *args) {
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_sleep_until_alarms_obj, 1, MP_OBJ_FUN_ARGS_MAX, alarm_sleep_until_alarms);

//| def set_deep_sleep_alarms(*alarms: Alarm) -> None:
//| """Set one or more alarms to wake up from a deep sleep.
//| def exit_and_deep_sleep_until_alarms(*alarms: Alarm) -> None:
//| """Exit the program and go into a deep sleep, until awakened by one of the alarms.
//|
//| When awakened, the microcontroller will restart and run ``boot.py`` and ``code.py``
//| When awakened, the microcontroller will restart and will run ``boot.py`` and ``code.py``
//| from the beginning.
//|
//| An alarm equivalent to the one that caused the wake-up is available as `alarm.wake_alarm`.
//| Its type and/or attributes may not correspond exactly to the original alarm.
//| For time-base alarms, currently, an `alarm.time.MonotonicTimeAlarm()` is created.
//| For time-base alarms, currently, an `alarm.time.TimeAlarm()` is created.
//|
//| If you call this routine more than once, only the last set of alarms given will be used.
//| If no alarms are specified, the microcontroller will deep sleep until reset.
//| """
//| ...
//|
STATIC mp_obj_t alarm_set_deep_sleep_alarms(size_t n_args, const mp_obj_t *args) {
STATIC mp_obj_t alarm_exit_and_deep_sleep_until_alarms(size_t n_args, const mp_obj_t *args) {
validate_objs_are_alarms(n_args, args);
common_hal_alarm_set_deep_sleep_alarms(n_args, args);
common_hal_exit_and_deep_sleep_until_alarms(n_args, args);
return mp_const_none;
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_set_deep_sleep_alarms_obj, 1, MP_OBJ_FUN_ARGS_MAX, alarm_set_deep_sleep_alarms);
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(alarm_exit_and_deep_sleep_until_alarms_obj, 1, MP_OBJ_FUN_ARGS_MAX, alarm_exit_and_deep_sleep_until_alarms);

//| """The `alarm.pin` module contains alarm attributes and classes related to pins.
//| """
Expand All @@ -123,7 +120,7 @@ STATIC const mp_obj_module_t alarm_pin_module = {
STATIC const mp_map_elem_t alarm_time_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_time) },

{ MP_ROM_QSTR(MP_QSTR_MonotonicTimeAlarm), MP_OBJ_FROM_PTR(&alarm_time_monotonic_time_alarm_type) },
{ MP_ROM_QSTR(MP_QSTR_TimeAlarm), MP_OBJ_FROM_PTR(&alarm_time_time_alarm_type) },
};

STATIC MP_DEFINE_CONST_DICT(alarm_time_globals, alarm_time_globals_table);
Expand All @@ -140,7 +137,8 @@ STATIC mp_map_elem_t alarm_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_wake_alarm), mp_const_none },

{ MP_ROM_QSTR(MP_QSTR_sleep_until_alarms), MP_OBJ_FROM_PTR(&alarm_sleep_until_alarms_obj) },
{ MP_ROM_QSTR(MP_QSTR_set_deep_sleep_alarms), MP_OBJ_FROM_PTR(&alarm_set_deep_sleep_alarms_obj) },
{ MP_ROM_QSTR(MP_QSTR_exit_and_deep_sleep_until_alarms),
MP_OBJ_FROM_PTR(&alarm_exit_and_deep_sleep_until_alarms_obj) },

{ MP_ROM_QSTR(MP_QSTR_pin), MP_OBJ_FROM_PTR(&alarm_pin_module) },
{ MP_ROM_QSTR(MP_QSTR_time), MP_OBJ_FROM_PTR(&alarm_time_module) }
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.