From 25cc779596e75e2e98c5119b88f63c141a672e2e Mon Sep 17 00:00:00 2001 From: Robert Zieba Date: Mon, 30 Jan 2023 22:26:51 +0000 Subject: zephyr/app/ec/ec_app_main: Fix timer handle allocation The timer struct used for preventing sleep within 15 seconds of boot was incorrectly placed on the stack. Change the struct to a static global. BRANCH=none BUG=b:249314949 TEST=Builds and runs on rex device Change-Id: Ia4818524847f587aec098c5cf1f897f45c22da50 Signed-off-by: Robert Zieba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4205805 Reviewed-by: Scott Collyer Commit-Queue: Scott Collyer --- zephyr/app/ec/ec_app_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/app/ec/ec_app_main.c b/zephyr/app/ec/ec_app_main.c index d2dad10b2d..160156f7bb 100644 --- a/zephyr/app/ec/ec_app_main.c +++ b/zephyr/app/ec/ec_app_main.c @@ -22,6 +22,7 @@ #include #include +static struct k_timer timer; static void console_allow_sleep(struct k_timer *timer) { pm_policy_state_lock_put(PM_STATE_SUSPEND_TO_IDLE, PM_ALL_SUBSTATES); @@ -49,7 +50,6 @@ void ec_app_main(void) } if (IS_ENABLED(CONFIG_PLATFORM_EC_BOOT_NO_SLEEP)) { - struct k_timer timer; k_timeout_t duration = K_MSEC(CONFIG_PLATFORM_EC_BOOT_NO_SLEEP_MS); -- cgit v1.2.1