summaryrefslogtreecommitdiff
path: root/chip/stm32/power_led.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-10-26 14:31:47 -0700
committerGerrit <chrome-bot@google.com>2012-10-29 16:52:49 -0700
commit1d916d7c6b25de10c870cf7f35a44d3654d9f099 (patch)
tree5d7337654d86766324103217ab61ae0b71d65e0f /chip/stm32/power_led.c
parent67aadcf614513353d7c9a0216fc70f7af18d8d05 (diff)
downloadchrome-ec-1d916d7c6b25de10c870cf7f35a44d3654d9f099.tar.gz
Use SECOND and MSEC constants
We'd defined them in a number of different files. This moves definitions to timer.h, and uses them everywhere we have large delays (since 10*SECOND is less typo-prone than 10000000). Also add msleep() and sleep() inline functions. No need for mdelay() or delay(), since any delays that long should use sleep funcs instead of spin-waiting. BUG=chrome-os-partner:15579 BRANCH=none TEST=boot system; taskinfo displays similar numbers to before Change-Id: I2a92a9f10f46b6b7b6571759b1f8ab4ecfbf8259 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/36726
Diffstat (limited to 'chip/stm32/power_led.c')
-rw-r--r--chip/stm32/power_led.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/stm32/power_led.c b/chip/stm32/power_led.c
index 09d9d426cd..f5448c0b82 100644
--- a/chip/stm32/power_led.c
+++ b/chip/stm32/power_led.c
@@ -22,8 +22,8 @@
#include "timer.h"
#include "util.h"
-#define LED_STATE_TIMEOUT_MIN 15000 /* minimum of 15ms per step */
-#define LED_HOLD_TIME 330000 /* hold for 330ms at min/max */
+#define LED_STATE_TIMEOUT_MIN (15 * MSEC) /* Minimum of 15ms per step */
+#define LED_HOLD_TIME (330 * MSEC) /* Hold for 330ms at min/max */
#define LED_STEP_PERCENT 4 /* incremental value of each step */
static enum powerled_state led_state = POWERLED_STATE_ON;