Commit Graph

24 Commits

Author SHA1 Message Date
hathach fecc1bdedb
fix typos (partial) detected by codepell 2023-03-18 22:17:02 +07:00
Dan Halbert 9307b62ad5 wip 2022-10-27 22:42:04 -04:00
Dan Halbert 60f43b1703 allow preserving pin state during deep sleep 2022-09-15 17:35:14 -04:00
Lucian Copeland 295103bb31 Merge remote-tracking branch 'upstream/main' into sleep-revamp 2021-05-13 16:22:12 -04:00
Lucian Copeland 7eeea869ac Fix light sleep global alarms, API revisions 2021-04-15 15:02:42 -04:00
Lucian Copeland d35a307ffa Merge branch 'sleep-api-update' into stm-alarm 2021-03-29 12:27:25 -04:00
Lucian Copeland 00178ca5e0 Sleep API changes, redundancy fix 2021-03-27 14:14:57 -04:00
Lucian Copeland 6b2c9985ff Extract RTC, implement fake RTC deepsleep 2021-03-11 17:50:05 -05:00
Lucian Copeland f1792c8474 Extract EXTI, create base sleep framework 2021-03-02 11:41:53 -05:00
microDev 0bad6110d4
update wake-alarm implementation 2020-12-31 02:44:20 +05:30
Scott Shawcroft 1fca297a2d
A couple sleep fixes
* Better messaging when code is stopped by an auto-reload.
* Auto-reload works during sleeps on ESP32-S2. Ticks wake up the
  main task each time.
* Made internal naming consistent. CamelCase Python names are NOT
  separated by an underscore.
2020-12-22 16:13:02 -08:00
Dan Halbert d4e9eea397
mark alarm.wake_alarm during gc sweep 2020-12-22 08:11:01 -08:00
Dan Halbert cf938983e9 SleepMemory + set alarm.wake_alarm 2020-12-11 08:10:26 -05:00
Scott Shawcroft 40118bcf57
Add `board_deinit` for use with sleep
This changes lots of files to unify `board.h` across ports. It adds
`board_deinit` when CIRCUITPY_ALARM is set. `main.c` uses it to
deinit the board before deep sleeping (even when pretending.)

Deep sleep is now a two step process for the port. First, the
port should prepare to deep sleep based on the given alarms. It
should set alarms for both deep and pretend sleep. In particular,
the pretend versions should be set immediately so that we don't
miss an alarm as we shutdown. These alarms should also wake from
`port_idle_until_interrupt` which is used when pretending to deep
sleep.

Second, when real deep sleeping, `alarm_enter_deep_sleep` is called.
The port should set any alarms it didn't during prepare based on
data it saved internally during prepare.

ESP32-S2 sleep is a bit reorganized to locate more logic with
TimeAlarm. This will help it scale to more alarm types.

Fixes #3786
2020-12-08 10:52:25 -08:00
Dan Halbert 8b7c23c1ee address review comments 2020-12-01 20:01:14 -05:00
Dan Halbert e308a9ec11 working! PinAlarm not implemented yet. 2020-11-27 16:03:37 -05:00
Dan Halbert 104a089677 deep sleep working; deep sleep delay when connected 2020-11-26 22:06:37 -05:00
Dan Halbert 9dbea36eac changed alarm.time API 2020-11-25 15:09:27 -05:00
Dan Halbert 7a45afc549 working, but need to avoid deep sleeping too fast before USB ready 2020-11-23 22:44:53 -05:00
Dan Halbert 3abee9b256 compiles; maybe ready to test, or almost 2020-11-22 21:52:37 -05:00
Dan Halbert a0f1ec3c4a wip 2020-11-22 19:10:09 -05:00
Dan Halbert 75559f35cc wip: ResetReason to microcontroller.cpu 2020-11-21 23:29:52 -05:00
Dan Halbert 39e1f52e28 wip; not compiling yet 2020-11-19 17:47:12 -05:00
Dan Halbert 682054a216 WIP: redo API; not compiled yet 2020-11-19 00:23:27 -05:00