/* switch in system clock out of ISR context.  */
static void SwitchSystemClock(void)
/* switch in system clock out of ISR context.  */
static void SwitchSystemClock(void)
{
  if (__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSI)
  {
    SystemClockHSE_Config();
  }
  else if (__HAL_RCC_GET_PLL_OSCSOURCE() == RCC_PLLSOURCE_HSE)
  {
    SystemClockHSI_Config();
  }
  SwitchClock = RESET;
}