summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2021-06-02 18:21:42 +0200
committerCommit Bot <commit-bot@chromium.org>2021-06-30 08:50:09 +0000
commit93c8503f4ba5fefc7c7a2a2d3db4b46f25a79de7 (patch)
tree3a3ffe74c1e37013c49e20163ad9f2bb5e5ac673 /common
parentd92274769d4590fb49fae2c9a478342d56b96834 (diff)
downloadchrome-ec-93c8503f4ba5fefc7c7a2a2d3db4b46f25a79de7.tar.gz
motion: check console task when available
motion_sense_init() checks if it was called in hooks task or console task context. In Zephyr console task is not available so TASK_ID_CONSOLE is not defined. Because of that HAS_TASK_CONSOLE is used to choose if check for hooks and console task or only for hooks task. BUG=none TEST=makeall BRANCH=none Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ie51b043209d5228c074bbc9a693bf7b98cf2a598 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2933302 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/motion_sense.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index c0d556b5cb..92690d7aea 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -331,8 +331,12 @@ static inline int motion_sense_init(struct motion_sensor_t *sensor)
int ret, cnt = 3;
BUILD_ASSERT(SENSOR_COUNT < 32);
+#if defined(HAS_TASK_CONSOLE)
ASSERT((task_get_current() == TASK_ID_HOOKS) ||
(task_get_current() == TASK_ID_CONSOLE));
+#else
+ ASSERT(task_get_current() == TASK_ID_HOOKS);
+#endif /* HAS_TASK_CONSOLE */
/* Initialize accelerometers. */
do {