summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2022-03-30 16:06:30 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-31 20:28:44 +0000
commit9198149037b783de361169e91793aba964c54ff9 (patch)
tree72a8c087456d3a5d08cfbfb877a537f53a8ffaa0 /zephyr
parent3d5ddbc6e8bad5d183fbb99d832475c9ed7381aa (diff)
downloadchrome-ec-9198149037b783de361169e91793aba964c54ff9.tar.gz
zephyr: fix build check for number of tasks
The Brya platform had 17 tasks, while the CONFIG_NUM_PREEMPT_PRIORITIES was set to 16, but the build check didn't catch this. Use BUILD_ASSERT for the check instead. BUG=none BRANCH=none TEST=Verify byra platform fails to build when CONFIG_NUM_PREEMPT_PRIORITIES is 16. TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibbccf546f9216acdf43475d9000a29ca199da6fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3562040 Reviewed-by: Sam Hurst <shurst@google.com>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/shim/src/tasks.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/zephyr/shim/src/tasks.c b/zephyr/shim/src/tasks.c
index 2226b9a54a..a2a4df8320 100644
--- a/zephyr/shim/src/tasks.c
+++ b/zephyr/shim/src/tasks.c
@@ -289,10 +289,9 @@ ZTEST_RULE(set_test_runner_tid, set_test_runner_tid_rule_before, NULL);
#endif /* CONFIG_SET_TEST_RUNNER_TID_RULE */
#endif /* TEST_BUILD */
-#if K_PRIO_PREEMPT(TASK_ID_COUNT - 1) >= K_IDLE_PRIO
-#error CONFIG_NUM_PREEMPT_PRIORITIES too small, some tasks would run at idle \
- priority
-#endif
+BUILD_ASSERT((K_PRIO_PREEMPT(TASK_ID_COUNT - 1) < K_IDLE_PRIO),
+ "CONFIG_NUM_PREEMPT_PRIORITIES too small, some tasks would run at "
+ "idle priority");
void start_ec_tasks(void)
{