how can l set interrupt priority on s32ds

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how can l set interrupt priority on s32ds

跳至解决方案
5,039 次查看
jinshuaixu
Contributor V

           below is tow interrupt code ,if I want to set systick interrupt prioyity higher than wdog, who can tell me below code is right or wrong.?l an a new user ,firstly use S32K144 and S32DS. 

           please give me code or example code,thank you .

/* Install IRQ handlers for WDOG and SysTick interrupts */
INT_SYS_InstallHandler(WDOG_EWM_IRQn, WDOG_ISR, (isr_t *)0);
INT_SYS_InstallHandler(SysTick_IRQn, SysTick_Handler, (isr_t *)0);


INT_SYS_SetPriority(WDOG_EWM_IRQn,0);
INT_SYS_SetPriority(SysTick_IRQn,1);

标签 (1)
0 项奖励
回复
1 解答
4,140 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The lower priority number, the higher priority level.

So in your code, the WDOG interrupt has higher priority then SysTick.

The code should be:

void WDOG_IRQ_handler(void) {   
// do something
}

void SysTick_IRQ_Handler(void){   
// do something
}

INT_SYS_InstallHandler(WDOG_EWM_IRQn, WDOG_IRQ_handler, (isr_t *)0);
INT_SYS_InstallHandler(SysTick_IRQn, SysTick_IRQ_Handler, (isr_t *)0);

INT_SYS_SetPriority(WDOG_EWM_IRQn, 1);
INT_SYS_SetPriority(SysTick_IRQn, 0);

INT_SYS_EnableIRQ(WDOG_EWM_IRQn);
INT_SYS_EnableIRQ(SysTick_IRQn);

Regards,

Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
4,141 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The lower priority number, the higher priority level.

So in your code, the WDOG interrupt has higher priority then SysTick.

The code should be:

void WDOG_IRQ_handler(void) {   
// do something
}

void SysTick_IRQ_Handler(void){   
// do something
}

INT_SYS_InstallHandler(WDOG_EWM_IRQn, WDOG_IRQ_handler, (isr_t *)0);
INT_SYS_InstallHandler(SysTick_IRQn, SysTick_IRQ_Handler, (isr_t *)0);

INT_SYS_SetPriority(WDOG_EWM_IRQn, 1);
INT_SYS_SetPriority(SysTick_IRQn, 0);

INT_SYS_EnableIRQ(WDOG_EWM_IRQn);
INT_SYS_EnableIRQ(SysTick_IRQn);

Regards,

Daniel

0 项奖励
回复