summaryrefslogtreecommitdiff
path: root/core/cortex-m/task.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m/task.c')
-rw-r--r--core/cortex-m/task.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index f9e4d11fdb..639cef9d48 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -177,6 +177,10 @@ inline int get_interrupt_context(void)
task_id_t task_get_current(void)
{
+#ifdef CONFIG_DEBUG_BRINGUP
+ /* If we haven't done a context switch then our task ID isn't valid */
+ ASSERT(current_task != (task_ *)scratchpad);
+#endif
return current_task - tasks;
}