diff options
author | Keith Packard <keithp@keithp.com> | 2012-10-24 22:46:55 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-25 00:07:14 -0700 |
commit | 4b13d3c659240e5a8347b1ba7ab0bf1d8355eba3 (patch) | |
tree | ef3e1a8e37d8ba3c362f1fdf43e5e9bd09157af9 /src/core/ao.h | |
parent | e80fa6de4ccc5c4851eab9fb941f9282d2e3eb16 (diff) |
altos: Add stack-guard code. Uses STM MPU to trap stack overflow.
This marks the lowest portion of the stack as inaccessible to the CPU,
causing the processor to fault when it reaches it. The fault then
generates a panic message so that the user can know what happened.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/core/ao.h')
-rw-r--r-- | src/core/ao.h | 1 |
1 files changed, 1 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 */ |