diff options
Diffstat (limited to 'src/fsm/common.c')
-rw-r--r-- | src/fsm/common.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/fsm/common.c b/src/fsm/common.c index 6e00740..ca4c009 100644 --- a/src/fsm/common.c +++ b/src/fsm/common.c @@ -25,6 +25,7 @@ #include "common.h" #include "FreeRTOS.h" #include "timers.h" +#include <stm32f4xx.h> static uint64_t common_timestamp = 0; // milliseconds since startup static TimerHandle_t common_timer; @@ -71,4 +72,15 @@ int random_bool(void) return bit; } +// For the debugger +static int faultsource = 0; +void trigger_fault(int source) +{ + __disable_irq(); + + faultsource = source; + + while (1) {} +} + |