diff options
Diffstat (limited to 'board/servo_micro/board.c')
-rw-r--r-- | board/servo_micro/board.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/board/servo_micro/board.c b/board/servo_micro/board.c index 7d9bd0bac5..ca97b1fbd7 100644 --- a/board/servo_micro/board.c +++ b/board/servo_micro/board.c @@ -13,6 +13,7 @@ #include "queue_policies.h" #include "registers.h" #include "spi.h" +#include "system.h" #include "task.h" #include "timer.h" #include "update_fw.h" @@ -673,6 +674,15 @@ const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports); int usb_i2c_board_is_enabled(void) { return 1; } +void pvd_interrupt(void) { + /* Clear Pending Register */ + STM32_EXTI_PR = EXTI_PVD_EVENT; + /* Handle recovery by rebooting the system */ + system_reset(0); +} + +DECLARE_IRQ(STM32_IRQ_PVD, pvd_interrupt, HOOK_PRIO_FIRST); + /****************************************************************************** * Initialize board. */ |