OS_Squeue_Wait_TO (squeue, os_smsg_type_var, timeout)
Same as OS_Squeue_Wait with exit if timeout expires. If timeout expires before message received, then stop waiting with Timeout flag set (see OS_IsTimeout)
OS_ENABLE_SQUEUE constant must be defined in OSAcfg.h.
Only in task
squeue |
Queue of simple messages descriptor. Variable of OST_SQUEUE 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_SQUEUE squeue; void Task (void) { OST_SMSG smsg; for (;;) { /*...*/ OS_Squeue_Wait_TO(squeue, smsg, 100); if (!OS_IsTimeout()) { // Simple message received and stored into smsg /*...*/ } /*...*/ } }
OS_WaitQSMsgTimeout