mcci-catena / Catena-Arduino-Platform

Arduino platform library for MCCI Catena IoT Systems
MIT License
12 stars 11 forks source link

CatenaStm32L0Rtc::SleepForAlarm() calls __HAL_PWR_CLEAR_FLAG w/o clocking #157

Closed terrillmoore closed 5 years ago

terrillmoore commented 5 years ago

CatenaStm32L0Rtc::SleepForAlarm() calls __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU), but doesn't ensure that the clock to the PWR register is turned on. In fact, by default, it's off. This makes this call useless. There is a new API in future BSPs, but testing indicates that this API is not needed -- the system still sleeps.

E.g. https://github.com/mcci-catena/Catena-Arduino-Platform/blob/d0a03aa83ec8fe4002b01cb74b7a2ba2a2c4d0f0/src/lib/stm32/stm32l0/CatenaStm32L0Rtc.cpp#L381-L382

Solution: remove calls.