circuitpython/ports/stm/common-hal
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
..
analogio Claim USB pins at startup to prevent overwrites 2020-07-22 14:22:05 -04:00
board create copy 2020-03-11 18:13:06 -04:00
busio Add `board_deinit` for use with sleep 2020-12-08 10:52:25 -08:00
canio canio: remove unused fields 2020-10-06 20:14:50 -05:00
digitalio Claim USB pins at startup to prevent overwrites 2020-07-22 14:22:05 -04:00
displayio Update parallel bus signatures 2020-11-13 18:57:52 -08:00
microcontroller address review comments 2020-12-01 20:01:14 -05:00
neopixel_write Initial work for STM32. Need to fix us delay and PulseIn still. 2020-03-20 12:58:34 -07:00
nvm Fix NVM by clearing FLASH_FLAG_PGPERR 2020-11-23 00:25:41 -08:00
os improve efficiency of stm32 random gen 2020-08-26 18:47:19 -04:00
pulseio Fix problematic whitespace on pulseout parameter errors 2020-08-27 11:07:47 -04:00
pwmio Merge remote-tracking branch 'upstream/main' into stm32-meowbit-fix 2020-08-26 18:50:26 -04:00
rgbmatrix wip 2020-11-22 19:10:09 -05:00
sdioio Add `board_deinit` for use with sleep 2020-12-08 10:52:25 -08:00
supervisor Fix up end of file and trailing whitespace. 2020-06-03 10:56:35 +01:00