-
Notifications
You must be signed in to change notification settings - Fork 2
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
Rework communication, flash and FRAM code #236
Merged
Conversation
This file contains 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
Now there are only functions taking std::spans or returning byte arrays.
The SPI test requires shorting the MISO and MOSI lines. Since on the COBC PCB there are external modules connected to the SPI, this is not really feasible.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #236 +/- ##
==========================================
+ Coverage 86.73% 87.35% +0.61%
==========================================
Files 17 18 +1
Lines 490 514 +24
==========================================
+ Hits 425 449 +24
Misses 65 65 ☔ View full report in Codecov by Sentry. |
Also, do some refactoring.
The new interface is like the one in Communication.hpp and intended to be used with Span().
Also, split the communication functions for UART and SPI into separate files.
I tried to test the non-blocking functions with the UCI UART but that did not work. We have to use the EDU UART. I guess that has to do with PRINTF().
The SPI interface only allowed to read byte spans while the UART one allowd spans of all types. I decided to go for the more generic one in both cases because it is more convenient.
This hopefully reduce binary sizes.
This reverts commit bfe7c24. By adding the UART functions without "extent" the size of CobcSw.bin built in release mode actually increased by 16 bytes instead of decreasing. Therefore, I reverted the commit.
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.
Description
This is a complete rework of the low-level communication functions for UART and SPI. Following that, the flash and FRAM code are updated, reworked and refactored as well. Of course, all effected tests are updated too. I guess the biggest changes are:
std::span
in all interfacesSpan()
to easily convert everything tostd::span
Fixes #38
Fixes #196
Fixes #238