OSIF_MutexLock in ISR

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

OSIF_MutexLock in ISR

1,457件の閲覧回数
赵子成
Contributor IV

Hi, everyone,

I use the SDK 3.0.0, Can I use the API OSIF_MutexLock and OSIF_MutexUnlock in ISR.

If not, how can I lock and unlock the shared resource in ISR?

Thanks very much.

0 件の賞賛
返信
1 返信

1,394件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello,

This functions can't be used in an ISR, you need to use the functions xSemaphoreGiveFromISR to release the semaphore, also I will suggest to not use lock functions in an ISR since the IRQ needs to be the shortest possible.

The usual approach is to use a semaphore/mutex take in the task to lock a peripheral or coordinate the tasks and use the give in the ISR to release the peripheral.

Best Regards,

Alexis Andalon 

0 件の賞賛
返信