This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

os_wait for signal and timeout

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--;
}
But in this case the FOR loop makes a loop on each signal, and I need to wait those 125msec although a signal was received. Any ideas?

Thanks a lot,
Ruven

0