Reflect watchdog reset with startup color
This commit is contained in:
parent
5169ddd4bd
commit
7331532dfa
@ -15,6 +15,8 @@ extern "C" void Error_Handler(void)
|
||||
|
||||
static inline void initializeHardware()
|
||||
{
|
||||
const auto resetByWatchdog = (__HAL_RCC_GET_FLAG(RCC_FLAG_IWDGRST)) ? true : false;
|
||||
|
||||
terminal_t terminal;
|
||||
|
||||
do {
|
||||
@ -24,8 +26,13 @@ static inline void initializeHardware()
|
||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, g_error ? GPIO_PIN_RESET : GPIO_PIN_SET);
|
||||
} while(g_error);
|
||||
|
||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_RESET);
|
||||
if(resetByWatchdog) {
|
||||
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_SET);
|
||||
}
|
||||
else {
|
||||
HAL_GPIO_WritePin(GREEN_LED_GPIO_Port, GREEN_LED_Pin, GPIO_PIN_RESET);
|
||||
}
|
||||
HAL_GPIO_WritePin(RED_LED_GPIO_Port, RED_LED_Pin, GPIO_PIN_RESET);
|
||||
HAL_GPIO_WritePin(BLUE_LED_GPIO_Port, BLUE_LED_Pin, GPIO_PIN_RESET);
|
||||
|
||||
HAL_Delay(1000);
|
||||
|
Loading…
Reference in New Issue
Block a user