#include "STM32.h"

int main(void)
{
  SystemClock_Config(Quartz_8);

  _SetSpeed(Speed_WeryHigh);
  _SetPinAlternate(GPIOA, GPIO_PIN_8, GPIO_AF0_MCO);

  RCC->CFGR |= (0b110 << RCC_CFGR_MCO1PRE_Pos);
  RCC->CFGR |= (0b11 << RCC_CFGR_MCO1_Pos);

  while (1)
  {
  }
}

void Error_Handler(void)
{
  /* USER CODE BEGIN Error_Handler_Debug */
  /* User can add his own implementation to report the HAL error return state */
//  __disable_irq();
  while (1)
  {
  }
  /* USER CODE END Error_Handler_Debug */
}

#ifdef  USE_FULL_ASSERT
/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t *file, uint32_t line)
{
  /* USER CODE BEGIN 6 */
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
  /* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */

