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

Move EDU program queue to FRAM #336

Merged
merged 15 commits into from
Jan 5, 2025
Merged

Move EDU program queue to FRAM #336

merged 15 commits into from
Jan 5, 2025

Conversation

jeromehue
Copy link
Contributor

Description

Fixes #203

@jeromehue jeromehue force-pushed the move-eduprogramqueue-fram branch 4 times, most recently from 3f72a25 to 403dd21 Compare December 22, 2024 12:48
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.98%. Comparing base (e80f2c5) to head (3342296).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #336      +/-   ##
==========================================
+ Coverage   79.68%   81.98%   +2.30%     
==========================================
  Files          47       49       +2     
  Lines        1580     1782     +202     
  Branches       57       77      +20     
==========================================
+ Hits         1259     1461     +202     
  Misses        321      321              

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

@jeromehue jeromehue marked this pull request as ready for review December 23, 2024 00:38
@PatrickKa PatrickKa force-pushed the move-eduprogramqueue-fram branch from 403dd21 to aeaeb9c Compare January 5, 2025 12:34
- Remove the member variables for the begin and end indexes and instead
  made the relevant functions take them as arguments or return them.
  This makes it more obvious which functions need or provide them.
- To reduce the number of times that the indexes are loaded from the
  FRAM, split some functions into two. One version for when the FRAM is
  working and one for when we only use the cache. This together with the
  first point allows loading the indexes only once in functions like
  `FindAndReplace()` and then passing them down the call chain.
- Change `SizeType`, `IndexType`, and the type of `nCachedElements` to
  the underlying type of `fram::Size`, which is `uint32_t`.
I forgot about this case so it was most likely undefined behaviour. Now
I changed it to return `T{}` instead.
- Do some refactoring
- Add tests for `Clear()`
- Test `Get()` on empty vectors
- Rename `Empty()` and `Full()` to `IsEmpty()` and `IsFull()`
- Fix `Get()` not returning last element if index is out of bounds
- Fix `IsFull()` always comparing the size to the FRAM capacity, even
  when the FRAM is not working
- Cache elements in serialized form to save RAM
- Remove member variable `size` and pass the size around instead
- Change `SizeType`, `IndexType`, and the type of `nCachedElements` to
  the underlying type of `fram::Size`, which is `uint32_t`
- Rename `Read/WriteElement()` to `Load/StoreElement()` to be consistent
  with `Load/StoreSize()`
- No longer call public functions from other public functions to prevent
  entering the semaphore twice
- Rename sections and persistent variables from indexes to metadata
@PatrickKa PatrickKa force-pushed the move-eduprogramqueue-fram branch from aeaeb9c to 3342296 Compare January 5, 2025 16:57
@PatrickKa PatrickKa merged commit c1ffc6b into master Jan 5, 2025
6 checks passed
@PatrickKa PatrickKa deleted the move-eduprogramqueue-fram branch January 5, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move EDU program queue to FRAM
3 participants