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

Use either LSI or LSE in RTC #218

Closed jcard0na closed 2 years ago

jcard0na commented 2 years ago

RTC can be used with an internal or external Low Speed clock (LSE or LSI). LSE is more accurate but requires an external crystal on the board. This diff adds the possibility to select LSI or LSE when RTC is created.

Also, modified existing examples to use LSI. This prevents them from freezing on boards without an LSE crystal. None of the examples seem to rely on high timing accuracy.

jamwaffles commented 2 years ago

Don't forget rustfmt/clippy too :). They look like pretty trivial changes thankfully.