modm-io / modm

modm: a C++23 library generator for AVR and ARM Cortex-M devices
https://modm.io
Mozilla Public License 2.0
720 stars 128 forks source link

Refactor IWDG driver and add initialize function for prescaler with downcounter #1127

Closed salkinium closed 5 months ago

salkinium commented 5 months ago

Re-opening this since I prematurely merged the previous PR #1122 due to pushing the wrong branch (PEBCAK). Addresses the last review. Original description:

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.