OS_Smsg_Wait_TO (smsg, os_smsg_type_var, timeout)
Same as OS_Smsg_Wait. If timeout expires before message received, then stop waiting with Timeout flag set (see OS_IsTimeout)
Only in task
smsg |
Simple message descriptor. Variable of OST_SMSG type |
os_smsg_type_var |
Variable of OST_SMSG type, where simple message will be placed |
timeout |
Time of waiting in system ticks - calling OS_Timer periods |
timeout |
If timeout expired then system service OS_IsTimeout will return true |
OST_SMSG smsg; void Task (void) { OST_SMSG mysmsg; for (;;) { /*...*/ OS_Smsg_Wait_TO (smsg, mysmsg, 30); // Wait 30 ticks for simple message if (!OS_IsTimeout()) { // Message has been received and stored into mysmsg /*...*/ } /*...*/ } }
OS_WaitSMsgTimeout