diff --git a/Core/Src/main.c b/Core/Src/main.c index 521d565..3026162 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -376,6 +376,9 @@ void Error_Handler(void) { /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { + ts_sm_set_relay_position(RELAY_NEG, 0); + ts_sm_set_relay_position(RELAY_POS, 0); + ts_sm_set_relay_position(RELAY_PRECHARGE, 0); } /* USER CODE END Error_Handler_Debug */ } diff --git a/Core/Src/stm32f3xx_it.c b/Core/Src/stm32f3xx_it.c index 182abcb..2c26531 100644 --- a/Core/Src/stm32f3xx_it.c +++ b/Core/Src/stm32f3xx_it.c @@ -74,6 +74,7 @@ void NMI_Handler(void) /* USER CODE BEGIN NonMaskableInt_IRQn 1 */ while (1) { + Error_Handler(); } /* USER CODE END NonMaskableInt_IRQn 1 */ } @@ -89,6 +90,7 @@ void HardFault_Handler(void) while (1) { /* USER CODE BEGIN W1_HardFault_IRQn 0 */ + Error_Handler(); /* USER CODE END W1_HardFault_IRQn 0 */ } } @@ -104,6 +106,7 @@ void MemManage_Handler(void) while (1) { /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */ + Error_Handler(); /* USER CODE END W1_MemoryManagement_IRQn 0 */ } } @@ -119,6 +122,7 @@ void BusFault_Handler(void) while (1) { /* USER CODE BEGIN W1_BusFault_IRQn 0 */ + Error_Handler(); /* USER CODE END W1_BusFault_IRQn 0 */ } } @@ -134,6 +138,7 @@ void UsageFault_Handler(void) while (1) { /* USER CODE BEGIN W1_UsageFault_IRQn 0 */ + Error_Handler(); /* USER CODE END W1_UsageFault_IRQn 0 */ } }