问 定时器TIM2的问题
我想用定时2 的定时功能。但是用IAR编译时提示这一句
NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel; //通道
有如下错误:
Error[Pe020]: identifier "TIM2_IRQChannel" is undefined
中断嵌套函数。
void NVIC_Config(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQChannel; //有错误
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;//
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; //
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
} |