summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ao.h1
-rw-r--r--src/core/ao_task.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/core/ao.h b/src/core/ao.h
index 2b375cfd..87e69e19 100644
--- a/src/core/ao.h
+++ b/src/core/ao.h
@@ -64,6 +64,7 @@
#define AO_PANIC_BT 11 /* Communications with bluetooth device failed */
#define AO_PANIC_STACK 12 /* Stack overflow */
#define AO_PANIC_SPI 13 /* SPI communication failure */
+#define AO_PANIC_CRASH 14 /* Processor crashed */
#define AO_PANIC_SELF_TEST_CC1120 0x40 | 1 /* Self test failure */
#define AO_PANIC_SELF_TEST_HMC5883 0x40 | 2 /* Self test failure */
#define AO_PANIC_SELF_TEST_MPU6000 0x40 | 3 /* Self test failure */
diff --git a/src/core/ao_task.c b/src/core/ao_task.c
index c2b1b270..df70b906 100644
--- a/src/core/ao_task.c
+++ b/src/core/ao_task.c
@@ -20,6 +20,9 @@
#if HAS_SAMPLE_PROFILE
#include <ao_sample_profile.h>
#endif
+#if HAS_STACK_GUARD
+#include <ao_mpu.h>
+#endif
#define AO_NO_TASK_INDEX 0xff
@@ -127,6 +130,9 @@ ao_yield(void) ao_arch_naked_define
ao_cur_task->start = ao_sample_profile_timer_value();
#endif
}
+#if HAS_STACK_GUARD
+ ao_mpu_stack_guard(ao_cur_task->stack);
+#endif
#if AO_CHECK_STACK
cli();
in_yield = 0;