Bootup animation for LED debugging + Freeze WDG when debugging
This commit is contained in:
parent
e46a75f99f
commit
88bba3441c
@ -191,12 +191,11 @@ int main(void)
|
|||||||
|
|
||||||
/* USER CODE BEGIN SysInit */
|
/* USER CODE BEGIN SysInit */
|
||||||
|
|
||||||
/* USER CODE END SysInit */
|
|
||||||
|
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
MX_CAN_Init();
|
MX_CAN_Init();
|
||||||
|
|
||||||
#if false
|
#if false
|
||||||
|
/* USER CODE END SysInit */
|
||||||
/* Initialize all configured peripherals */
|
/* Initialize all configured peripherals */
|
||||||
MX_GPIO_Init();
|
MX_GPIO_Init();
|
||||||
MX_CAN_Init();
|
MX_CAN_Init();
|
||||||
@ -204,6 +203,9 @@ int main(void)
|
|||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Freeze WDG when debugging
|
||||||
|
__HAL_DBGMCU_FREEZE_IWDG();
|
||||||
|
|
||||||
// Ensure we start with SDC disabled
|
// Ensure we start with SDC disabled
|
||||||
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_RESET);
|
||||||
|
|
||||||
@ -250,8 +252,16 @@ int main(void)
|
|||||||
bool pAMC = false;
|
bool pAMC = false;
|
||||||
mission_t new_mission = mission; // By default, don't change mission
|
mission_t new_mission = mission; // By default, don't change mission
|
||||||
|
|
||||||
// Important to prevent bus error state while ABX is starting up
|
// Wait 1s to prevent bus error state while ABX is starting up
|
||||||
HAL_Delay(1000);
|
// During that time, show loading animation to show LEDs work
|
||||||
|
setMissionLED(M_MANUAL, GPIO_PIN_SET);
|
||||||
|
HAL_Delay(150);
|
||||||
|
setMissionLED(M_MANUAL, GPIO_PIN_RESET);
|
||||||
|
for (mission_t m = M_ACCEL; m != M_MANUAL; m = mission2next[m]) {
|
||||||
|
setMissionLED(m, GPIO_PIN_SET);
|
||||||
|
HAL_Delay(150);
|
||||||
|
setMissionLED(m, GPIO_PIN_RESET);
|
||||||
|
}
|
||||||
|
|
||||||
MX_IWDG_Init();
|
MX_IWDG_Init();
|
||||||
WD_initialized = true;
|
WD_initialized = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user