static void SystemClock_Config(void) { RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitTypeDef RCC_OscInitStruct; /* Select HSI48 Oscillator as PLL source */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI48; RCC_OscInitStruct.HSI48State = RCC_HSI48_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI48; RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV2; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct)!= HAL_OK) { Error_Handler(); /*原函数1 处 } /* Select PLL as system clock source and configure the HCLK and PCLK1 clocks dividers */ RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1); RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1)!= HAL_OK) { Error_Handler(); } /*原函数2处 } 原函数1: */ __weak HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct) { /* Note : This function is defined into this file for library reference. */ /* Function content is located into file stm32f0xx_hal_rcc_ex.c to */ /* handle the possible oscillators present in STM32F0xx devices */ /* Return error status as not implemented here */ return HAL_ERROR; } 原函数2: __weak HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency) { /* Note : This function is defined into this file for library reference. */ /* Function content is located into file stm32f0xx_hal_rcc_ex.c to */ /* handle the possible oscillators present in STM32F0xx devices */ /* Return error status as not implemented here */ return HAL_ERROR; } 亲爱的大侠们,我在学习STM32F072的HAL库的时候经常遇到上面有颜色的函数,这段函数具体是怎么动作的?请知道的朋友说一下吧!感谢 |
是不是在调用函数时,会硬件操作 |