From f738021657caed66cfd98a143732a715440b3c13 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Tue, 15 May 2012 14:29:38 -0700 Subject: [PATCH] Rearrange task priorities Charging state machine doesn't need to be able to preempt everybody. Keyboard scanning and power button should preempt, because they need to debounce/scan at a stable rate. Signed-off-by: Randall Spangler BUG=none TEST=system still boots Change-Id: Id57c680b9fa4652bc10d19270620d63788a7b269 --- board/link/ec.tasklist | 10 +++++----- core/cortex-m/task.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/board/link/ec.tasklist b/board/link/ec.tasklist index 006d69cb2a..2aee1d9be2 100644 --- a/board/link/ec.tasklist +++ b/board/link/ec.tasklist @@ -16,14 +16,14 @@ #define CONFIG_TASK_LIST \ TASK(WATCHDOG, watchdog_task, NULL) \ TASK(LIGHTBAR, lightbar_task, NULL) \ + TASK(POWERSTATE, charge_state_machine_task, NULL) \ TASK(TEMPSENSOR, temp_sensor_task, NULL) \ TASK(THERMAL, thermal_task, NULL) \ TASK(PWM, pwm_task, NULL) \ - TASK(KEYSCAN, keyboard_scan_task, NULL) \ TASK(TYPEMATIC, keyboard_typematic_task, NULL) \ - TASK(POWERBTN, power_button_task, NULL) \ TASK(X86POWER, x86_power_task, NULL) \ - TASK(CONSOLE, console_task, NULL) \ - TASK(HOSTCMD, host_command_task, NULL) \ TASK(I8042CMD, i8042_command_task, NULL) \ - TASK(POWERSTATE, charge_state_machine_task, NULL) + TASK(HOSTCMD, host_command_task, NULL) \ + TASK(CONSOLE, console_task, NULL) \ + TASK(POWERBTN, power_button_task, NULL) \ + TASK(KEYSCAN, keyboard_scan_task, NULL) diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index b21d2cd59c..d69b607208 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -75,9 +75,9 @@ void __idle(void) cprintf(CC_TASK, "[%T idle task started]\n"); while (1) { - /* Wait for the irq event */ + /* Wait for the next irq event. This stops the CPU clock + * (sleep / deep sleep, depending on chip config). */ asm("wfi"); - /* TODO: more power management here */ } }