summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2023-01-30 22:26:51 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-31 02:28:01 +0000
commit25cc779596e75e2e98c5119b88f63c141a672e2e (patch)
tree17afb7525216ba2dcf9d51d5bd663f25631785e6
parentd97ab1cd05355fa7b26ac2d6bf3074b95e0b30d9 (diff)
downloadchrome-ec-25cc779596e75e2e98c5119b88f63c141a672e2e.tar.gz
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 <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4205805 Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
-rw-r--r--zephyr/app/ec/ec_app_main.c2
1 files changed, 1 insertions, 1 deletions
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 <zephyr/shell/shell_uart.h>
#include <zephyr/sys/printk.h>
+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);