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 IWDG driver and add initialize function for prescaler with downcounter #1122

Merged
merged 9 commits into from
Jan 31, 2024

Conversation

salkinium
Copy link
Member

@salkinium salkinium commented Jan 21, 2024

Ok, this escalated a little. I was just looking through the code and saw that the Iwdg class was not inlined, so I quickly refactored it and then noticed that the prescaler was manually computed and then I had to program a constexpr algorithm for it.

  • Inline IWDG functions
  • Move into modm::platform namespace.
  • Add prescaler + downcounter algorithm.
  • Add unittest for prescaler + downcounter algorithm.
  • Add Rcc::Lsi and Rcc::Hsi clock.
  • Add modm.digsep filter for nicely formatting long integers.
  • Add SystemClock::Iwdg to every board.
  • Add a generic assertBaudrateInTolerance implementation.
  • Add documentation for prescaler calculators.
  • Simplify tolerance assertion functions.
  • Added seconds_t, milliseconds_t, microseconds_t for template parameters.
  • percent_t can be float since C++20.
  • Fix minimum prescaler value for STM32 UART (8 or 16).
  • Implement iterator correctly so that the warnings go away. Help!

@salkinium salkinium force-pushed the feature/init_iwdg_by_time branch from 055da7b to 3dc8cd8 Compare January 26, 2024 19:47
@salkinium salkinium force-pushed the feature/init_iwdg_by_time branch 3 times, most recently from 1654c8b to c0f5bbf Compare January 28, 2024 18:38
@salkinium salkinium force-pushed the feature/init_iwdg_by_time branch from c0f5bbf to 2dc6769 Compare January 28, 2024 19:01
@salkinium salkinium marked this pull request as ready for review January 28, 2024 19:02
@salkinium salkinium added the ci:hal Triggers the exhaustive HAL compile CI jobs label Jan 28, 2024
Copy link
Member

@chris-durand chris-durand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

@salkinium salkinium merged commit 2dc6769 into modm-io:develop Jan 31, 2024
39 checks passed
@salkinium
Copy link
Member Author

Great, I messed up and merged this accidentally while rebasing. Fantastic…

@salkinium
Copy link
Member Author

There's no way to open a merged PR, unlike closed PRs, so I'll address the review in a separate PR on the weekend. Damn it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants