[riot-notifications] [RIOT-OS/RIOT] cpu/sam0: add support for SAMD5x/SAME5x (#11305)

Kees Bakker notifications at github.com
Fri Mar 29 22:28:14 CET 2019


keestux commented on this pull request.



> +                DEBUG("pm_set(): setting IDLE1 mode.\n");
+                _mode = PM_SLEEPCFG_SLEEPMODE_IDLE1;
+                break;
+            case 3:
+                DEBUG("pm_set(): setting IDLE0 mode.\n");
+                _mode = PM_SLEEPCFG_SLEEPMODE_IDLE0;
+                break;
+        }
+
+        /* write sleep configuration */
+        PM->SLEEPCFG.bit.SLEEPMODE = _mode;
+        /* make sure value has been set */
+        while (PM->SLEEPCFG.bit.SLEEPMODE != _mode) {}
+    }
+
+    cortexm_sleep(mode);

There are now four variants of this, all have a different approach to call `cortexm_sleep`. In this implementation it is important to identify that only `mode == 0` does a light sleep. The other modes do a deep sleep. I don't see it being documented.

Also the mapping 0->STANDBY, 1->IDLE2, 2->IDLE1, 3->IDLE0 needs explanation or documentation.

-- 
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/11305#pullrequestreview-220764874
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190329/143ab1cf/attachment.html>


More information about the notifications mailing list