[riot-notifications] [RIOT-OS/RIOT] cpu/stm32: add STOP and STANDBY low-power for stm32f3, unify for all stm32 (#11211)

Vincent Dupont notifications at github.com
Wed Mar 20 17:53:08 CET 2019


vincent-d requested changes on this pull request.

Code-wise this is OK, maybe the SRAM2 thing could be made configurable.

I don't have time to test it, sorry.

I'm OK with one PR for all, this is small enough.

>  void pm_set(unsigned mode)
 {
     int deep;
 
     switch (mode) {
 #ifdef STM32_PM_STANDBY
         case STM32_PM_STANDBY:
-            PWR->CR &= ~(PM_STOP_CONFIG | PM_STANDBY_CONFIG);
-            PWR->CR |= PM_STANDBY_CONFIG;
+            PWR_CR_REG &= ~(PM_STOP_CONFIG | PM_STANDBY_CONFIG);
+            PWR_CR_REG |= PM_STANDBY_CONFIG;
+#if defined(CPU_FAM_STM32L4)
+            /* Disable SRAM2 retention for maximum power saving */
+            PWR->CR3 &= ~PWR_CR3_RRS;

Maybe this should be configurable

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11211#pullrequestreview-216850480
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190320/b1db2f48/attachment.html>


More information about the notifications mailing list