Hello all, My software is based RTX51-Full. Does someone has any idea how can I wait for a signal a X msec, but if I receive the signal in this period of time I'll still wait until the end of this X time before continue with program? My code looks like this:
for (i=0 ; i<4 ; i++) { if(os_wait(K_SIG+K_TMO,_125MS,0)==SIG_EVENT) { if((cNumOfCh & stRcvMsg.sa)==0) cNumOfCh |= stRcvMsg.sa; os_clear_signal(AH_RCVMSG); } else i--; }
How about:
for (i=0 ; i<4 ; i++) { os_wait(K_TMO, _125MS, 0); if (os_wait(K_SIG, 0, 0) == SIG_EVENT) { if((cNumOfCh & stRcvMsg.sa)==0) cNumOfCh |= stRcvMsg.sa; os_clear_signal(AH_RCVMSG); } else { i--; } }
Thanks Jon. How is it sometimes you don't see the solution in front of your eyes???