File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,18 @@ namespace klib::core::lpc175x::io {
1919 * @param cal_value
2020 * @param cal_direction
2121 */
22+ template <bool Override = false >
2223 static void init (const uint32_t cal_value = 0 , const bool cal_direction = 1 ) {
2324 // enable the power for the rtc
2425 target::io::power_control::enable<Rtc>();
2526
26- // check if the rtc is already on (and not in reset)
27- if (Rtc::port->CCR & 0x1 && !(Rtc::port->CCR & (0x1 << 1 ))) {
28- // rtc already on. No need for more configuration
29- return ;
27+ // check if we should always override any configuration
28+ if constexpr (!Override) {
29+ // check if the rtc is already on (and not in reset)
30+ if (Rtc::port->CCR & 0x1 && !(Rtc::port->CCR & (0x1 << 1 ))) {
31+ // rtc already on. No need for more configuration
32+ return ;
33+ }
3034 }
3135
3236 // disable the oscillator fail detect interrupt
You can’t perform that action at this time.
0 commit comments