Example of using xSemaphoreGiveFromISR in both ISR and a task

danbeadle wrote on Friday, August 14, 2015:

I want to create a generic object that can protect its resource. In my case, it is a SPI channel object. I need to be able to call this from either a normal task or from an ISR.

I saw a post from 2009, but didn’t understand the reply.

Alternatively, is there a way to determine at run time if a function has been invoked from a task or from an ISR?

rtel wrote on Saturday, August 15, 2015:

I can only answer your question with a question - which port are you using?