在stm32f10x_rcc.c文件中有
static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9};
void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)两句
void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks)中有句
/* Get PCLK1 prescaler */
tmp = RCC->CFGR & CFGR_PPRE1_Set_Mask; //CFGR_PPRE1_Set_Mask=0x00000700获取PPRE1:低速APB预分频(APB1
tmp = tmp >> 8; //把数据移到最低位
presc = APBAHBPrescTable[tmp]; //有问题????????????????????????????????????????????????????
/* PCLK1 clock frequency */
RCC_Clocks-> CLK1_Frequency = RCC_Clocks->HCLK_Frequency >> presc;
怎么对应不上啊?求指点!!还有和这个一块的HCLK,PCLK2的也对应不上, |