I have a resource to be synchronized on task accesses. I made a code (in the resource driver) to use xSemaphoreTake/Give for this synchronization.
I now have a case that this resource needs to be accessed from ISR. This requires that the lock process take/give be done in the calling function (instead of the driver) since it might be the task or isr. This adds a little complexity.
My question: Is there away in FreeRTOS to know if the code being executed is from a task or isr?
If yes, is it going to take too much cpu time?