配置了相关设置,但是怎么都进不了中断。
void timerLP_config(void)
{
RCC_EnableLsi(ENABLE);
NVIC_InitType NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = LPTIM_TIM6_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
RCC_ConfigLPTIMClk(RCC_LPTIMCLK_SRC_LSI);
RCC_EnableAPB1PeriphClk(RCC_APB1_PERIPH_LPTIM | RCC_APB1_PERIPH_LPTIMPCLK,ENABLE);
LPTIM_SetPrescaler(LPTIM,LPTIM_PRESCALER_DIV1);
LPTIM_EnableIT_CMPM(LPTIM);
/* config lptim ARR and compare register */
LPTIM_Enable(LPTIM);
LPTIM_SetAutoReload(LPTIM,35000);
LPTIM_SetCompare(LPTIM,30000);
LPTIM_StartCounter(LPTIM,LPTIM_OPERATING_MODE_CONTINUOUS);
} |