OSIF_MutexLock in ISR

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

OSIF_MutexLock in ISR

1,581 次查看
赵子成
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,518 次查看
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 项奖励
回复