stm32-rs / stm32l0xx-hal

A hardware abstraction layer (HAL) for the STM32L0 series microcontrollers written in Rust
BSD Zero Clause License
96 stars 60 forks source link

Fixed bad op for RTC wakeup #156

Closed allexoll closed 3 years ago

allexoll commented 3 years ago

^ was probably intended as "power" but is XOR in this context, limiting delay to a maximum of 2 XOR 17, or ..=19

hannobraun commented 3 years ago

Thank you, @allexoll, good catch!

One note: I think the method documentation is somewhat wrong. Under "Panics", it states <= 2^17, which doesn't match the new implementation, or the rest of the method's documentation. It should probably be < 2^17.

I'm merging this PR now, since it's a strict improvement (the documentation is not more wrong than it was before), and am going to open an issue to track the documentation problem. A follow-up PR that fixes the documentation issue would be very welcome!

allexoll commented 3 years ago

done in PR#157