From b081af1284c2e63747451bc8984d27e8430a9bb4 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Fri, 15 Jun 2012 19:37:54 +0000 Subject: stm32f100: implement low power mode When the AP is not running and we have enough time go to STOP mode instead of simple idle. The EC consumption should drop from 12mW to a few mW. This is currently not activated by default, you need to type "sleepmask 0" in the EC console to activate it. Signed-off-by: Vincent Palatin BUG=chrome-os-partner:8866 TEST=on Snow, check the software is still working properly when STOP mode is activated and measure power consumption on 3v_alw rail. Change-Id: I231d76fe6494c07b198c41694755b82d87c00e75 Reviewed-on: https://gerrit.chromium.org/gerrit/29315 Tested-by: Vincent Palatin Reviewed-by: Randall Spangler Commit-Ready: Vincent Palatin --- core/cortex-m/task.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index 154994bccf..a45e8e0e32 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -36,7 +36,7 @@ typedef union { /* declare task routine prototypes */ #define TASK(n, r, d) int r(void *); #include TASK_LIST -static void __idle(void); +void __idle(void); CONFIG_TASK_LIST #undef TASK @@ -63,6 +63,7 @@ static uint32_t irq_dist[CONFIG_IRQ_COUNT]; /* Distribution of IRQ calls */ extern void __switchto(task_ *from, task_ *to); extern int __task_start(int *task_stack_ready); +#ifndef CONFIG_LOW_POWER_IDLE /* Idle task. Executed when no tasks are ready to be scheduled. */ void __idle(void) { @@ -77,6 +78,7 @@ void __idle(void) asm("wfi"); } } +#endif /* !CONFIG_LOW_POWER_IDLE */ static void task_exit_trap(void) -- cgit v1.2.1