You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/04/11 23:25:38 UTC
[08/28] incubator-mynewt-core git commit: Enter low power state in
the idle loop by using the "WFI" instruction.
Enter low power state in the idle loop by using the "WFI" instruction.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/a9b6d9eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/a9b6d9eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/a9b6d9eb
Branch: refs/heads/develop
Commit: a9b6d9eb99ed91d7f9a4fb80f5ea65da863ba950
Parents: 4a7ff05
Author: Neel Natu <ne...@nahannisys.com>
Authored: Fri Mar 25 12:51:51 2016 -0700
Committer: Neel Natu <ne...@nahannisys.com>
Committed: Fri Mar 25 12:51:51 2016 -0700
----------------------------------------------------------------------
libs/os/src/arch/cortex_m0/os_arch_arm.c | 7 +++++++
libs/os/src/arch/cortex_m4/os_arch_arm.c | 7 +++++++
2 files changed, 14 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a9b6d9eb/libs/os/src/arch/cortex_m0/os_arch_arm.c
----------------------------------------------------------------------
diff --git a/libs/os/src/arch/cortex_m0/os_arch_arm.c b/libs/os/src/arch/cortex_m0/os_arch_arm.c
index 224c045..7e6e433 100755
--- a/libs/os/src/arch/cortex_m0/os_arch_arm.c
+++ b/libs/os/src/arch/cortex_m0/os_arch_arm.c
@@ -336,5 +336,12 @@ os_arch_os_start(void)
void
os_arch_idle(void)
{
+ os_sr_t sr;
+
+ OS_ENTER_CRITICAL(sr);
+ __DSB();
+ __WFI();
+ OS_EXIT_CRITICAL(sr);
+
return;
}
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/a9b6d9eb/libs/os/src/arch/cortex_m4/os_arch_arm.c
----------------------------------------------------------------------
diff --git a/libs/os/src/arch/cortex_m4/os_arch_arm.c b/libs/os/src/arch/cortex_m4/os_arch_arm.c
index a819e43..72b9f45 100755
--- a/libs/os/src/arch/cortex_m4/os_arch_arm.c
+++ b/libs/os/src/arch/cortex_m4/os_arch_arm.c
@@ -326,5 +326,12 @@ os_arch_os_start(void)
void
os_arch_idle(void)
{
+ os_sr_t sr;
+
+ OS_ENTER_CRITICAL(sr);
+ __DSB();
+ __WFI();
+ OS_EXIT_CRITICAL(sr);
+
return;
}