small refactor of some spi and timerwrapper functionality#631
Open
victor-Lopez25 wants to merge 14 commits intodevelopmentfrom
Open
small refactor of some spi and timerwrapper functionality#631victor-Lopez25 wants to merge 14 commits intodevelopmentfrom
victor-Lopez25 wants to merge 14 commits intodevelopmentfrom
Conversation
Contributor
ST-LIB Release Plan
Pending changes
|
FoniksFox
previously approved these changes
Apr 23, 2026
Contributor
FoniksFox
left a comment
There was a problem hiding this comment.
Will have to further improve these things, but it is good for now
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors timer and SPI wrapper APIs to make common configuration patterns less cumbersome, and tightens scheduler timer selection to 32-bit timers.
Changes:
- Add
TimerWrapper::set_callback(callback, callback_data)to set the ISR callback/data without configuring period. - Allow
SCHEDULER_TIMER_DOMAINto be set to TIM5 (32-bit) instead of TIM3. - Add a blocking SPI
transceive(T* tx, T* rx, size_t count)overload (pointer + count).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| Inc/HALAL/Services/Time/TimerWrapper.hpp | Adds set_callback helper that directly updates TimerDomain callback tables. |
| Inc/HALAL/Models/TimerDomain/TimerDomain.hpp | Restricts scheduler timer selection to known 32-bit timers (2/5/23/24). |
| Inc/HALAL/Models/SPI/SPI2.hpp | Adds pointer+count blocking transceive overload alongside existing span overloads. |
| .changesets/refactor-spi-timerwrapper.md | Adds a changeset entry describing the refactor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…oop-UPV/ST-LIB into refactor/spi-timerwrapper
FoniksFox
approved these changes
Apr 29, 2026
oganigl
approved these changes
Apr 30, 2026
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.
timerwrapper:
set_callback(void (*callback)(void*), void* callback_data)to set the callback and its data instead of needing to callconfigurexxbit()and set the period.set_limit_value(uint32_t arr)to set the arr, this will likely be changed to use auint32_ttype only when using a 32 bit timer, for now it is just an alias toinstance->tim->ARR = arr;.spi:
transcievewith ptr + data explicitly instead of using a span since it's sometimes a pain in the ass to use.