diff --git a/src/main/drivers/system_stm32f7xx.c b/src/main/drivers/system_stm32f7xx.c index b978f9c682..41c6eb2bc5 100644 --- a/src/main/drivers/system_stm32f7xx.c +++ b/src/main/drivers/system_stm32f7xx.c @@ -30,6 +30,8 @@ #include "drivers/nvic.h" #include "drivers/system.h" +#include "stm32f7xx_ll_cortex.h" + #define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000) void SystemClock_Config(void); diff --git a/src/main/fc/fc_hardfaults.c b/src/main/fc/fc_hardfaults.c index d0163d7e52..e575c4a2e4 100644 --- a/src/main/fc/fc_hardfaults.c +++ b/src/main/fc/fc_hardfaults.c @@ -36,6 +36,12 @@ void MemManage_Handler(void) { LED2_ON; + // fall out of the sky + uint8_t requiredStateForMotors = SYSTEM_STATE_CONFIG_LOADED | SYSTEM_STATE_MOTORS_READY; + if ((systemState & requiredStateForMotors) == requiredStateForMotors) { + stopMotors(); + } + #ifdef USE_TRANSPONDER // prevent IR LEDs from burning out. uint8_t requiredStateForTransponder = SYSTEM_STATE_CONFIG_LOADED | SYSTEM_STATE_TRANSPONDER_ENABLED; diff --git a/src/main/platform.h b/src/main/platform.h index b7e89232e4..000d0b9bcf 100644 --- a/src/main/platform.h +++ b/src/main/platform.h @@ -31,7 +31,6 @@ #include "stm32f7xx_hal.h" #include "system_stm32f7xx.h" -#include "stm32f7xx_ll_cortex.h" #include "stm32f7xx_ll_spi.h" #include "stm32f7xx_ll_gpio.h" #include "stm32f7xx_ll_dma.h"