/**
* @简介 配置系统时钟源, PLL乘法和除法因子, AHB/APBx prescalers and Flash settings
* @Note This function should be called only once the RCC clock configuration
* is reset to the default reset state (done in SystemInit() function).
* @param None
* @retval None
*/
static void SetSysClock(void)
{
/******************************************************************************/
/* PLL (clocked by HSE) 用作系统时钟源 */
/******************************************************************************/
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
/* 使能外部高速时钟 */
RCC->CR |= ((uint32_t)RCC_CR_HSEON);
/* 等待外部时钟准备好,如果时间超出则退出 */
do
{
HSEStatus = RCC->CR & RCC_CR_HSERDY;
StartUpCounter++;
} while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CR & RCC_CR_HSERDY) != RESET)
{
HSEStatus = (uint32_t)0x01;
}
else
{
HSEStatu
STM32F4的时钟配置文件system_stm32f4xx.c说明
最新推荐文章于 2025-05-16 09:25:48 发布