The difference between INT_SYS_DisableIRQGlobal and taskENTER_CRITICAL

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

The difference between INT_SYS_DisableIRQGlobal and taskENTER_CRITICAL

2,364件の閲覧回数
赵子成
Contributor IV

Hi experts,

I noticed the SDK supply two function: INT_SYS_DisableIRQGlobal and taskENTER_CRITICAL. They all disable interrupt. What is the difference?
And also the INT_SYS_EnableIRQGlobal and taskEXIT_CRITICAL?
Thanks.

0 件の賞賛
返信
1 返信

2,291件の閲覧回数
dianabatrlova
NXP TechSupport
NXP TechSupport

Hello,

INT_SYS_DisableIRQGlobal / INT_SYS_EnableIRQGlobal functions are included in SDK and will disable/enable the global interrupt by calling the core API. These functions are also available without using FreeRTOS.

The macros below are FreeRTOS macros.

taskENTER_CRITICAL /taskEXIT_CRITICAL and taskDISABLE_INTERRUPTS/taskENABLE_INTERRUPTS.

The big difference is:

"Calls to taskENTER_CRITICAL() and taskEXIT_CRITICAL() are designed to nest. Therefore, a critical section will only be exited when one call to taskEXIT_CRITICAL() has been executed for every preceding call to taskENTER_CRITICAL()."

For more detail see this link: This page describes the FreeRTOS taskENTER_CRITICAL() and taskEXIT_CRITICAL() API macros 

Also, this question on FreeRTOS forum was discussed:

difference between taskENTER_CRITICAL and tas - FreeRTOS 

I hope it helps.

Best regards,

Diana

0 件の賞賛
返信