Skip to content

Update after RTC enum naming changed #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/STM32LowPower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,24 +177,24 @@ void STM32LowPower::programRtcWakeUp(uint32_t millis, LP_Mode lp_mode)
int epoc;
uint32_t sec;
STM32RTC& rtc = STM32RTC::getInstance();
STM32RTC::RTC_Source_Clock clkSrc = rtc.getClockSource();
STM32RTC::Source_Clock clkSrc = rtc.getClockSource();

switch(lp_mode) {
case IDLE_MODE:
case SLEEP_MODE:
break;
// LSI or LSE must be selected as clock source to wakeup the device.
case DEEP_SLEEP_MODE:
clkSrc = (clkSrc == STM32RTC::RTC_HSE_CLOCK) ? STM32RTC::RTC_LSI_CLOCK : clkSrc;
clkSrc = (clkSrc == STM32RTC::HSE_CLOCK) ? STM32RTC::LSI_CLOCK : clkSrc;
break;
default:
case SHUTDOWN_MODE:
#ifdef STM32L4xx
// For shutdown mode LSE have to be used (STM32L4 series only)
clkSrc = STM32RTC::RTC_LSE_CLOCK;
clkSrc = STM32RTC::LSE_CLOCK;
#else
// LSE or LSI
clkSrc = (clkSrc == STM32RTC::RTC_HSE_CLOCK) ? STM32RTC::RTC_LSI_CLOCK : clkSrc;
clkSrc = (clkSrc == STM32RTC::HSE_CLOCK) ? STM32RTC::LSI_CLOCK : clkSrc;
#endif
break;
}
Expand Down