Skip to content
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

Fix #132: Configure Sleep interval to StopWithLowPowerRegulator #134

Closed
wants to merge 1 commit into from
Closed
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
11 changes: 7 additions & 4 deletions src/lib/stm32/stm32l0/CatenaStm32L0_Sleep.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* CatenaStm32L0_Sleep.cpp Wed Oct 31 2018 10:57:42 chwon */
/* CatenaStm32L0_Sleep.cpp Mon Apr 08 2019 16:32:20 dhineshkumar */

/*

Expand All @@ -8,10 +8,10 @@ Module: CatenaStm32L0_Sleep.cpp
Home for CatenaStm32L0::Sleep()

Version:
V0.11.0 Wed Oct 31 2018 10:57:42 chwon Edit level 1
V0.11.1 Mon Apr 08 2019 16:32:20 dhineshkumar Edit level 2

Copyright notice:
This file copyright (C) 2018 by
This file copyright (C) 2018-2019 by

MCCI Corporation
3520 Krums Corners Road
Expand All @@ -29,6 +29,9 @@ Revision history:
0.11.0 Wed Oct 31 2018 10:57:42 chwon
Module created.

0.11.1 Mon Apr 08 2019 16:32:20 dhineshkumarr
Call SleepForAlarm with SleepMode StopWithLowPowerRegulator.

*/

#ifdef ARDUINO_ARCH_STM32
Expand Down Expand Up @@ -96,7 +99,7 @@ Name: CatenaStm32L0::Sleep()
void CatenaStm32L0::Sleep(uint32_t howLongInSeconds)
{
this->m_Rtc.SetAlarm(howLongInSeconds);
this->m_Rtc.SleepForAlarm(CatenaStm32L0Rtc::SleepMode::Standby);
this->m_Rtc.SleepForAlarm(CatenaStm32L0Rtc::SleepMode::StopWithLowPowerRegulator);

// add the number of ms that we were asleep to the millisecond timer.
// we don't need extreme accuracy.
Expand Down