Interrupt in freertos_i2c

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

Interrupt in freertos_i2c

跳至解决方案
1,374 次查看
davidzhu
Contributor III

Hello,

I am testing freertos_i2c_frdmk66f demo project.

I found master task has a higher priority than slave task

/*******************************************************************************
* Definitions
******************************************************************************/


/* Task priorities. */
#define slave_task_PRIORITY (configMAX_PRIORITIES - 1)
#define master_task_PRIORITY (configMAX_PRIORITIES - 2)

But slave IRQ has a higher priority than master irq.

I don't understand this, could someone please can explain it?

0 项奖励
回复
1 解答
1,237 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi

Please be noted that ISR has higher priority over the tasks.

A task is a software feature that is unrelated to the hardware on which FreeRTOS is running. The priority of a task is assigned in software by the application writer, and scheduler decides which task will be in the running state.

An interrupt service is a hardware feature because hardware controls which interrupt routine will run. Tasks will only run when there are no ISRs running. So the lowest priority interrupt will interrupt the highest priority task.

For FreeRTOS task priority, the bigger the number, the lower is the priority.

Regards

Daniel

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,238 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi

Please be noted that ISR has higher priority over the tasks.

A task is a software feature that is unrelated to the hardware on which FreeRTOS is running. The priority of a task is assigned in software by the application writer, and scheduler decides which task will be in the running state.

An interrupt service is a hardware feature because hardware controls which interrupt routine will run. Tasks will only run when there are no ISRs running. So the lowest priority interrupt will interrupt the highest priority task.

For FreeRTOS task priority, the bigger the number, the lower is the priority.

Regards

Daniel

0 项奖励
回复