summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/motion_sense.c6
-rw-r--r--common/usbc/usb_pd_dpm.c2
2 files changed, 4 insertions, 4 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];
diff --git a/common/usbc/usb_pd_dpm.c b/common/usbc/usb_pd_dpm.c
index e3a392d5dc..5053f0a482 100644
--- a/common/usbc/usb_pd_dpm.c
+++ b/common/usbc/usb_pd_dpm.c
@@ -468,7 +468,7 @@ static void balance_source_ports(void)
uint32_t removed_ports, new_ports;
static bool deferred_waiting;
- if (task_get_current() == TASK_ID_HOOKS)
+ if (in_deferred_context())
deferred_waiting = false;
/*