I have a function that does a post on a semaphore and at times this same function might be called by a thread, to make this code easier I was just calling the C_ISR_PostSemaphore, so it is ISR safe. Does this cause any issues calling C_ISR_PostSemaphore via a thread instead of PostSemaphore?
Also, one caveat is only one type of calling function is enabled at anyone time... ie a thread calls the function no ISR is configured... the user does something... then disables the thread and enables the ISR... etc...
For example
commonFoo()
{
...
VDK::C_ISR_PostSemaphore(semaphore)
}
void ISR()
{
commonFoo();
}
workerThread()
{
.... code
commonFoo()
}
The ISR functions are not designed to be called from kernel or thread levels. In theory there should not be a problem doing but it is not something that we recommend. Instead, I would suggest calling the right API from the commonFoo function like this