summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-02-16 10:05:07 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-16 23:58:11 +0000
commit2e6bee5642be6d863c8a87b8bf60643b99c64f62 (patch)
tree5c0b377183554f18e61cd0967b7c30013d89f45d
parentada0cc90a4361556f81e83be0485224979ceb956 (diff)
downloadchrome-ec-2e6bee5642be6d863c8a87b8bf60643b99c64f62.tar.gz
stm32f0: Change idle task warning printf to save stack space
Change the idle task overslept warning printf to save stack space. The current warning uses CPRINTF which adds too much to the stack and overflows the idle stack. BUG=chrome-os-partner:33138, chrome-os-partner:36636 BRANCH=samus TEST=comment out the if (margin_us < 0) check and always print warning message. Without this CL stack overflows. With this CL, stack does not overflow and gets to 168/256, which is plenty of headroom considering the task doesn't do much. Change-Id: I19a8336b8584d2a1342e7b9290aad471d326a060 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/250300 Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
-rw-r--r--chip/stm32/clock-stm32f0.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c
index 6dfe0a1447..e6ed36e898 100644
--- a/chip/stm32/clock-stm32f0.c
+++ b/chip/stm32/clock-stm32f0.c
@@ -397,7 +397,8 @@ void __idle(void)
/* Calculate how close we were to missing deadline */
margin_us = next_delay - rtc_diff;
if (margin_us < 0)
- CPRINTS("overslept by %dus", -margin_us);
+ /* Use CPUTS to save stack space */
+ CPUTS("Idle overslept!\n");
/* Record the closest to missing a deadline. */
if (margin_us < dsleep_recovery_margin_us)