diff options
author | Damien George <damien@micropython.org> | 2021-04-29 15:21:22 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-04-29 16:54:35 +1000 |
commit | 647fa63f9c457b616b1b20fdd98403b681302680 (patch) | |
tree | c5d0431e899e0b10f8e9e998b4af14648f96db34 /docs/esp8266/tutorial | |
parent | 89b64478c73d2228419e77a4450c004157ec725a (diff) |
stm32/softtimer: Support static soft timer instances.
This adds support for making static (ie not on the Python GC heap) soft
timers. This can be useful for a board to define a custom background
handler, or eventually for BLE/network processing to use instead of systick
slots; it will be more efficient using soft timer for this.
The main issue with using the existing code for static soft timers is that
it would combine heap allocated and statically allocated soft_timer_entry_t
instances in the same pairing-heap data structure. This would prevent the
GC from tracing some of the heap allocated entries (because the GC won't
follow pointers outside the heap).
This commit makes it so that soft timer entries are explicitly marked,
instead of relying on implicit marking by having the root of the pairing
heap in the root pointer section. Also, on soft reset only the heap-
allocated soft timers are deleted from the pairing heap, leaving the
statically allocated ones.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'docs/esp8266/tutorial')
0 files changed, 0 insertions, 0 deletions