Commit Graph

27 Commits

Author SHA1 Message Date
Dan Halbert d4d96bb25f
Merge pull request #4236 from jun2sak/nrf52-sleep
sleep and wakeup for nrf52
2021-04-28 12:11:31 -04:00
Scott Shawcroft 76033d5115
Merge MicroPython v1.11 into CircuitPython 2021-04-26 15:47:41 -07:00
Lucian Copeland 15764b4c24 Merge remote-tracking branch 'upstream/main' into nrf52-sleep 2021-04-09 13:48:45 -04:00
Lucian Copeland 00178ca5e0 Sleep API changes, redundancy fix 2021-03-27 14:14:57 -04:00
microDev a52eb88031
run code formatting script 2021-03-15 19:27:36 +05:30
jun2sak 3e47e00291 address the pretending-to-deep-sleep issue. 2021-02-28 15:57:37 +09:00
microDev 0bad6110d4
update wake-alarm implementation 2020-12-31 02:44:20 +05:30
microDev 28ce5e8988
Merge branch 'main' into touch-s2 2020-12-30 22:44:22 +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
microDev 8eaf2b0c19
implement touch alarm 2020-12-18 12:54:36 +05:30
Dan Halbert 39124b888b doc fixes 2020-12-11 09:03:45 -05:00
Dan Halbert cf938983e9 SleepMemory + set alarm.wake_alarm 2020-12-11 08:10:26 -05:00
Dan Halbert 5964163649 Initial SleepMemory code 2020-12-10 13:03:40 -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 9391c8f9dd Make ResetReason and RunReason available 2020-12-06 12:00:00 -05: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 ef0830bfe2 merge from upstream + wip 2020-11-25 17:52:06 -05:00
Dan Halbert 9dbea36eac changed alarm.time API 2020-11-25 15:09:27 -05:00
Dan Halbert f868cc5dd0 some API renaming and bug fixes; fix docs 2020-11-24 23:37:05 -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 e4c66990e2 compiles 2020-11-20 23:33:39 -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