circuitpython/supervisor
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
..
messages Support internationalisation. 2018-08-07 14:58:57 -07:00
shared Add `board_deinit` for use with sleep 2020-12-08 10:52:25 -08:00
stub Add some NORETURN attributes 2020-09-28 18:55:56 -05:00
background_callback.h background_callback: Add gc collect callback 2020-07-17 08:36:26 -05:00
board.h Add `board_deinit` for use with sleep 2020-12-08 10:52:25 -08:00
cpu.h Mark pointers in cpu registers as in use. 2018-07-03 05:45:50 -07:00
filesystem.h flush flash filesystem once a second 2019-03-20 12:21:36 -04:00
flash.h Add license to some obvious files. 2020-07-06 19:16:25 +01:00
flash_root_pointers.h Move atmel-samd to tinyusb and support nRF flash. 2018-11-08 17:25:30 -08:00
linker.h Linker file restructure, TCM and MPU additions 2020-04-03 16:33:18 -04:00
memory.h Fix align32_size(). 2020-11-28 17:54:34 +01:00
port.h Add `board_deinit` for use with sleep 2020-12-08 10:52:25 -08:00
serial.h improve USB CDC disconnect/reconnect checking 2020-10-30 22:25:50 -04:00
spi_flash_api.h Implement requested changes 2020-01-28 17:11:25 -05:00
supervisor.mk Start tweaking the workflow to sleep 2020-10-27 17:55:03 -07:00
usb.h Merge pull request #3223 from dhalbert/unmount-before-reset 2020-07-29 10:47:24 -07:00
workflow.h Start tweaking the workflow to sleep 2020-10-27 17:55:03 -07:00