OSIF_MutexLock in ISR

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OSIF_MutexLock in ISR

560 Views
赵子成
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 Kudos
1 Reply

497 Views
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 Kudos