Skip to content

stm32: Support static soft timer instances (v2) #7170

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

dpgeorge
Copy link
Member

This is an alternative to #7143. The implementation here has two separate pairing heaps, one for static timers and one for GC allocated timers. It is simpler.

Signed-off-by: Damien George <damien@micropython.org>
This adds support for making static (ie not on the Python GC heap) soft
timers.  This can be useful for a board to define some 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 there are two separate pairing heaps, one for
static and one for heap allocated entries.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge
Copy link
Member Author

After some thought, #7143 is a better implementation.

@dpgeorge dpgeorge closed this Apr 29, 2021
@dpgeorge dpgeorge deleted the stm32-static-soft-timer-v2 branch April 29, 2021 07:15
tannewt added a commit to tannewt/circuitpython that referenced this pull request May 3, 2024
Enable BLE where we can. Switch 4MB, non-USB board default partitioning
over to a single 2MB firmware bank. Old boards override this setting to
keep the same behavior.

This also adds alpha support for the ESP32-C2 (aka ESP8684).

Fixes micropython#5926 and micropython#7170
tannewt added a commit to tannewt/circuitpython that referenced this pull request May 17, 2024
Enable BLE where we can. Switch 4MB, non-USB board default partitioning
over to a single 2MB firmware bank. Old boards override this setting to
keep the same behavior.

This also adds alpha support for the ESP32-C2 (aka ESP8684).

Fixes micropython#5926 and fixes micropython#7170
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant