在线时间1 小时
UID369453
ST金币0
蝴蝶豆0
注册时间2012-7-9
初级会员
- 最后登录
- 1970-1-1
|
a0a.1 0b0c
stm32f103芯片:关于定时器的问题
如果配置三个定时器的话NVIC_PriorityGroupConfig(NVIC_PriorityGroup_x)是不是应该配成NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2)???例如:
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
NVIC_InitStructure.NVIC_IRQChannel = TIM4_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 2;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
并且 NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);只用写一次就行,而不用每个中断都写?? |
|