summaryrefslogtreecommitdiff
path: root/common/motion_sense.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/motion_sense.c')
-rw-r--r--common/motion_sense.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 6a93e15dde..a9b15fd071 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -332,10 +332,10 @@ static inline int motion_sense_init(struct motion_sensor_t *sensor)
BUILD_ASSERT(SENSOR_COUNT < 32);
#if defined(HAS_TASK_CONSOLE)
- ASSERT((task_get_current() == TASK_ID_HOOKS) ||
+ ASSERT((in_deferred_context()) ||
(task_get_current() == TASK_ID_CONSOLE));
#else
- ASSERT(task_get_current() == TASK_ID_HOOKS);
+ ASSERT(in_deferred_context());
#endif /* HAS_TASK_CONSOLE */
/* Initialize accelerometers. */
@@ -386,7 +386,7 @@ static void motion_sense_switch_sensor_rate(void)
struct motion_sensor_t *sensor;
unsigned int sensor_setup_mask = 0;
- ASSERT(task_get_current() == TASK_ID_HOOKS);
+ ASSERT(in_deferred_context());
for (i = 0; i < motion_sensor_count; ++i) {
sensor = &motion_sensors[i];