Pointer to a semaphore handle?

Will the following work: /*——- start of c file ———-*/ static xSemaphoreHandle *localSemPtr; void init_peripheral( xSemaphoreHandle *semPtr ){ ____localSemPtr = semPtr; ____vSemaphoreCreateBinary( *localSemPtr ); } ISR( INT0_vect ){ ____xSemaphoreGiveFromISR( *localSemPtr ); }

Pointer to a semaphore handle?

If I can interpret what it is you are trying to do. You have a peripheral that uses a semaphore, presumably for synchronisation.  The semaphore is created externally from the peripheral driver and a reference to it is passed into the peripheral driver. I think this should work, but you can pass semaphore handles by copy.  You don’t need to pass them by pointer. static xSemaphoreHandle xLocalSem; void init_peripheral( xSemaphoreHandle xSem ) { ____xLocalSem = xSem; } ISR( INT0_vect ) { ____xSemaphoreGiveFromISR( xLocalSem ); } This is because the semaphore handle is only a reference to the semaphore.  It is not the entire semaphore structure. Take a look at the files serial.c and serialISR.c in the FreeRTOSDemoARM7_STR75x_GCCserialserial.c file for an example that uses queue handles (same thing really).  The function vConfigureQueues() is used to pass the handles to queues created in the serial.c file into the serialISR.c file.  The latter file contains the ISR function in which the queues are used. Regards.