I use xSemaphoreHandle as global variable in my program.
Declaration is the next:
xSemaphoreHandle xComSemaphore in main.c
extern xSemaphoreHandle xComSemaphore in all other .c files.
I check its value when I create it: vSemaphoreCreateBinary( xComSemaphore);
But in my interrupts file, when I check its value in next function xSemaphoreGiveFromISR(xComSemaphore, &xHigherPriorityTaskWoken ); I saw that the value was different from the one during creation.
For information, I don’t use any Compiler optimization.
I know that xSemaphoreHandle is a pointer to a xQUEUE structure, but I don’t understand why this value had change? Is it forbidden to use global variable for xSemaphoreHandle?
Thanks for your help.