Skip to content
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

Refactor EDU code #249

Merged
merged 31 commits into from
Feb 10, 2024
Merged

Refactor EDU code #249

merged 31 commits into from
Feb 10, 2024

Conversation

PatrickKa
Copy link
Contributor

@PatrickKa PatrickKa commented Jan 14, 2024

Description

Apart from only using the new HAL UART and removing the STOP command, I did some long overdue refactoring of the EDU code. I

  • renamed lots of things,
  • got rid of Names.hpp,
  • combined Enums.hpp and Structs.hpp,
  • improved the reception function,
  • refactored GetStatus() and GetStatusCommunication,
  • removed or combined some ErrorCodes,
  • and cleaned up PRINTF() calls and commented out code.

Fixes #215
Fixes #191
Fixes #248
Fixes #171
Fixes #235

@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (fcb8544) 87.35% compared to head (db8dc2d) 87.15%.

Files Patch % Lines
Sts1CobcSw/Edu/EduMock.cpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
- Coverage   87.35%   87.15%   -0.20%     
==========================================
  Files          18       18              
  Lines         514      514              
==========================================
- Hits          449      448       -1     
- Misses         65       66       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This is more convenient than having to provide a receive buffer in the
user code all the time.
Also, replace `= 0U` with `= 0` every time `auto` is not used.
Now, all high-level EDU commands can be sent in the same way.
Also, rename Structs.ipp to Types.ipp
The data structs for the statuses now follow the same logic as those for
the EDU commands: the ID is a static constexpr member and the name has a
"Data" suffix.
This finishes the quest to only use non-blocking funtions for all EDU
communication.
@PatrickKa PatrickKa marked this pull request as ready for review February 4, 2024 18:57
The normal ComputeCrc32() function changed to using the HW unit. The HW
and SW methods are not identical though, so I switched to
ComputeCrc32Sw() to get the behavior that the EDU expects right now.
This is the same number of times that the EDU will attempt to send data.
@PatrickKa PatrickKa merged commit 2759332 into master Feb 10, 2024
6 checks passed
@PatrickKa PatrickKa deleted the refactor-edu branch February 10, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants