中斷嵌套問題
static?uint32_t?SysTick_Config(uint32_t?ticks)
{
????SysTick->CTLR?=?0x00000000;?????????????//控制寄存器復(fù)位

????SysTick->SR?=?0x00000000;???????????????//狀態(tài)寄存器復(fù)位

????SysTick->CNT?=?0x00000000;??????????????//計數(shù)器復(fù)位,設(shè)置初始值為0

????SysTick->CMP?=?ticks;???????????????????//給重加載寄存器賦值

????NVIC_SetPriority(SysTicK_IRQn,?15);?????//設(shè)置SysTick中斷優(yōu)先級

????NVIC_EnableIRQ(SysTicK_IRQn);???????????//使能開啟Systick中斷

????SysTick->CTLR?|=?0x0000000B;????????????//啟動系統(tǒng)計數(shù)器STK(HCLK/8時基)

????return?(0);
}
void?drv_tim3_init(u16?hz)
{
????TIM_TimeBaseInitTypeDef?TIM_TimeBaseInitStructure?=?{0};
????NVIC_InitTypeDef????????NVIC_InitStructure?=?{0};

????RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3,?ENABLE);

????TIM_TimeBaseInitStructure.TIM_Period?=?100000?/?hz;
????TIM_TimeBaseInitStructure.TIM_Prescaler?=?SystemCoreClock?/?100000;
????TIM_TimeBaseInitStructure.TIM_ClockDivision?=?TIM_CKD_DIV1;
????TIM_TimeBaseInitStructure.TIM_CounterMode?=?TIM_CounterMode_Up;
????TIM_TimeBaseInitStructure.TIM_RepetitionCounter?=?0x00;
????TIM_TimeBaseInit(TIM3,?&TIM_TimeBaseInitStructure);

????TIM_ITConfig(TIM3,?TIM_IT_Update,?ENABLE);

????NVIC_InitStructure.NVIC_IRQChannel?=?TIM3_IRQn;
????NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority?=?1;
????NVIC_InitStructure.NVIC_IRQChannelSubPriority?=?3;
????NVIC_InitStructure.NVIC_IRQChannelCmd?=?ENABLE;
????NVIC_Init(&NVIC_InitStructure);
????TIM_Cmd(TIM3,?DISABLE);
}

CH32V203配置的兩個中斷,當(dāng)timer3中斷產(chǎn)生的時候,systicKZ中斷就不能正常中斷,中斷嵌套的功能怎么沒有實現(xiàn)?是否是我的配置有問題?


您好,關(guān)于中斷嵌套,是指當(dāng)兩個中斷同時產(chǎn)生時,高優(yōu)先級的中斷會優(yōu)先進行中斷處理,或高優(yōu)先級中斷會打斷正在運行的低優(yōu)先級中斷,待高優(yōu)先級中斷處理完成之后再處理低優(yōu)先級中斷,并不是指兩個中斷會同時運行。關(guān)于優(yōu)先級,數(shù)值越小,優(yōu)先級越高



只有登錄才能回復(fù),可以選擇微信賬號登錄

国产91精品新入口,国产成人综合网在线播放,九热这里只有精品,本道在线观看,美女视频a美女视频,韩国美女激情视频,日本美女pvp视频