当有用到 STM32F030 的PF0/PF1作为普通IO口使用时,必须设置芯片使用内部RC时钟,
将 这段代码:
RCC->CR &= ~((uint32_t)RCC_CR_HSEON);
加入到 system_stm32f0xx.c 文件的 static void SetSysClock(void) 这个子程中
static void SetSysClock(void)//ºËÐÄʱÖÓƵÂÊÉèÖÃ
{
__IO uint32_t StartUpCounter = 0, HSEStatus = 0;
/* SYSCLK, HCLK, PCLK configuration ----------------------------------------*/
/* Enable HSE */
// RCC->CR |= ((uint32_t)RCC_CR_HSEON);//ÅäÖÃΪʹÓÃÍⲿ¾§ÕñʱÖÓ
RCC->CR &= ~((uint32_t)RCC_CR_HSEON);//ÅäÖÃΪʹÓÃÄÚ²¿RCʱÖÓ,ͬʱ¹Øϵµ½PF0ºÍPF1×÷ΪÆÕͨIO¿ÚµÄÅäÖÃ
/* Wait till HSE is ready and if Time out is reached exit */
do
{
HSEStatus = RCC->CR & RCC_CR_HSERDY;
StartUpCounter++;
} while ((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
if ((RCC->CR & RCC_CR_HSERD