OS_Squeue_Send_TO (squeue, smessage, timeout)
Same as OS_Squeue_Send with exit if timeout expires.
OS_ENABLE_SQUEUE constant must be defined in OSAcfg.h.
Only in task
squeue |
Queue of simple messages descriptor. Variable of OST_SQUEUE type. |
smessage |
Message body (OST_SMSG) |
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) { for (;;) { /*...*/ OS_Squeue_Send_TO (squeue, 'E', 10); // Wait 10 ticks for free space if (OS_IsTimeout()) { // Message was not sent! /*...*/ } /*...*/ } }
OS_SendQSMsgTimeout