OS_Msg_Send_TO (msg_cb, message, timeout)
Same as OS_Msg_Send with exit if timeout expires. If timeout expires before msg_cb is free then new message will not be sent.
Only in task
msg_cb |
Pointer to message descriptor. Variable of OST_MSG_CB type |
message |
pointer to message body (OST_MSG) |
timeout |
Time of waiting in system ticks - calling OS_Timer periods |
timeout |
If timeout expired then system service OS_IsTimeout will return true |
OST_MSG_CB msg_cb; void Task (void) { OST_MSG msg; static char buf[10]; for (;;) { /*...*/ OS_Msg_Send_TO (msg_cb, buf, 100); if (OS_IsTimeout()) { // Message is not sent! /*...*/ } /*...*/ } }
OS_SendMsgTimeout