Bootup animation for LED debugging + Freeze WDG when debugging
This commit is contained in:
		@ -191,12 +191,11 @@ int main(void)
 | 
			
		||||
 | 
			
		||||
  /* USER CODE BEGIN SysInit */
 | 
			
		||||
 | 
			
		||||
  /* USER CODE END SysInit */
 | 
			
		||||
 | 
			
		||||
  MX_GPIO_Init();
 | 
			
		||||
  MX_CAN_Init();
 | 
			
		||||
 | 
			
		||||
#if false
 | 
			
		||||
  /* USER CODE END SysInit */
 | 
			
		||||
  /* Initialize all configured peripherals */
 | 
			
		||||
  MX_GPIO_Init();
 | 
			
		||||
  MX_CAN_Init();
 | 
			
		||||
@ -204,6 +203,9 @@ int main(void)
 | 
			
		||||
  /* USER CODE BEGIN 2 */
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
  // Freeze WDG when debugging
 | 
			
		||||
  __HAL_DBGMCU_FREEZE_IWDG();
 | 
			
		||||
 | 
			
		||||
  // Ensure we start with SDC disabled
 | 
			
		||||
  HAL_GPIO_WritePin(Watchdog_GPIO_Port, Watchdog_Pin, GPIO_PIN_RESET);
 | 
			
		||||
 | 
			
		||||
@ -250,8 +252,16 @@ int main(void)
 | 
			
		||||
  bool pAMC = false;
 | 
			
		||||
  mission_t new_mission = mission; // By default, don't change mission
 | 
			
		||||
 | 
			
		||||
  // Important to prevent bus error state while ABX is starting up
 | 
			
		||||
  HAL_Delay(1000);
 | 
			
		||||
  // Wait 1s to prevent bus error state while ABX is starting up
 | 
			
		||||
  // 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();
 | 
			
		||||
  WD_initialized = true;
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user