From 2e6bee5642be6d863c8a87b8bf60643b99c64f62 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Mon, 16 Feb 2015 10:05:07 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/250300 Reviewed-by: Duncan Laurie --- chip/stm32/clock-stm32f0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- cgit v1.2.1