小弟最近在学习ucos,使用的stm32开发板(stm32f103vet6),建立2个Task,跑LED,效果正常(使用的是被人的例程)
其中,有个时钟SysTick配置函数小弟没看懂,希望大神指教,如下是部分源码~~~
static void systick_init(void)
{
RCC_ClocksTypeDef rcc_clocks; /*这个rcc_Clocks是个局部变量,那我如何知道rcc_clocks.HCLK_Frequency是多少啊?*/
RCC_GetClocksFreq(&rcc_clocks);
SysTick_Config(rcc_clocks.HCLK_Frequency /* OS_TICKS_PER_SEC); /*这个SysTick时钟是多少呢???*/
}
#define OS_TICKS_PER_SEC 1000 /* Set the number of ticks in one second */
typedef struct
{
uint32_t SYSCLK_Frequency; /*!< returns SYSCLK clock frequency expressed in Hz */
uint32_t HCLK_Frequency; /*!< returns HCLK clock frequency expressed in Hz */
uint32_t PCLK1_Frequency; /*!< returns PCLK1 clock frequency expressed in Hz */
uint32_t PCLK2_Frequency; /*!< returns PCLK2 clock frequency expressed in Hz */
uint32_t ADCCLK_Frequency; /*!< returns ADCCLK clock frequency expressed in Hz */
}RCC_ClocksTypeDef;
|