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.
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