OSSemPend not allowing other code to run
Posted: Mon Feb 01, 2021 11:59 am
I have a project I'm building for MOD5270.
I have a main loop. At the beginning of it, during the initializing. the Semaphores are initialized and the timers started.
I then call the subroutines that will pend and wait for a semaphore before continuing on. Now, calling this subroutine, the code should return to main() once the Pend is hit. Correct? But the code never leaves this routine -- call Time_Handler and you're stuck in it. Shouldn't the code that's pending release to the main loop again?
void Time_Handler(char * inbuffer, char * outbuffer, UINT16 * resbuffer)
{
ptrIn = inbuffer;
ptrOut = outbuffer;
ptrRes = resbuffer;
spifunction = 1;
while(1)
{
OSSemPend( &TIME_SEM, 0 ); // wait for semaphore but doesn't let anything else run
I have a main loop. At the beginning of it, during the initializing. the Semaphores are initialized and the timers started.
I then call the subroutines that will pend and wait for a semaphore before continuing on. Now, calling this subroutine, the code should return to main() once the Pend is hit. Correct? But the code never leaves this routine -- call Time_Handler and you're stuck in it. Shouldn't the code that's pending release to the main loop again?
void Time_Handler(char * inbuffer, char * outbuffer, UINT16 * resbuffer)
{
ptrIn = inbuffer;
ptrOut = outbuffer;
ptrRes = resbuffer;
spifunction = 1;
while(1)
{
OSSemPend( &TIME_SEM, 0 ); // wait for semaphore but doesn't let anything else run