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

Cleaning up nRF52 code #152

Merged
merged 10 commits into from
Dec 12, 2024
Merged

Cleaning up nRF52 code #152

merged 10 commits into from
Dec 12, 2024

Conversation

jonathanpallant
Copy link
Member

@jonathanpallant jonathanpallant commented Dec 10, 2024

  • Removing some more static mut
  • Removed some sketchy atomic/volatile pointer stuff
  • Added defmt::timestamp!
  • Added a custom log format (which looks nicer, whilst we wait for probe-rs to do a release)
  • Port the dongle firmware over to use RTIC
    • removes a bunch more static mut that 1.83 warned about
    • also gives us a chance to talk more about larger RTIC programs

No more static mut. Plus we have functions that return microseconds, which is what defmt::timestamps really wants.
Also has optional timestamps.
Also regenerated the trace files.
Copy link

cloudflare-workers-and-pages bot commented Dec 10, 2024

Deploying ferrous-systems-rust-exercises with  Cloudflare Pages  Cloudflare Pages

Latest commit: 64b7beb
Status: ✅  Deploy successful!
Preview URL: https://42dcaeed.ferrous-systems-rust-exercises.pages.dev
Branch Preview URL: https://fix-static-mut-again.ferrous-systems-rust-exercises.pages.dev

View logs

Currently it operates a USB Serial port.
) Tested HID channel change.
) Tested USB Serial interface
) Tested radio loopback.

Just needs changing to run on the dongle and not the DK.
@jonathanpallant
Copy link
Member Author

I ported both puzzle-fw and loopback-fw to use RTIC. So now we have no more sketchy static mut stuff going on.

The usb_device is only used in the ISR, so it can be a local. Saves us a lock.
@jonathanpallant
Copy link
Member Author

I fixed the build error (I was looking for a file that only existed in some intermediate version) and squashed that and some other fixes.

Then I spotted clippy was having opinions, so I cleaned up a few more things.

@jonathanpallant
Copy link
Member Author

@listochkin listochkin merged commit f22b639 into main Dec 12, 2024
3 checks passed
@listochkin listochkin deleted the fix-static-mut-again branch December 12, 2024 14:40
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.

2 participants