Repository navigation
stm32: Support static soft timer instances. - #7143
Merged
Merged
Conversation
dpgeorge
force-pushed
the
stm32-static-soft-timer
branch
from
April 22, 2021 01:08
a454c8f to
209872f
Compare
dpgeorge
force-pushed
the
stm32-static-soft-timer
branch
2 times, most recently
from
April 29, 2021 06:24
04c2743 to
6093e71
Compare
Signed-off-by: Damien George <[email protected]>
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 <[email protected]>
dpgeorge
force-pushed
the
stm32-static-soft-timer
branch
from
April 29, 2021 06:55
6093e71 to
647fa63
Compare
tannewt
pushed a commit
to tannewt/circuitpython
that referenced
this pull request
Nov 16, 2022
Espressif add back `ESP32_CAMERA`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_tinstances 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 PR 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. This PR also deletes only the heap-allocated soft timers from the pairing heap on soft reset, leaving the statically allocated ones.
An alternative to this approach would be to have two separate pairing heaps, one for static and one for heap allocated entries, but for execution efficiency it's better to just have a single pairing heap.