38 #ifndef OS_MSGQUEUE_H__
39 #define OS_MSGQUEUE_H__
60 typedef uint8_t MsgQ_t;
75 #define OS_MSG_Q_POST(task, msg, delay, period, async ) do {\
76 static uint8_t os_posted;\
79 queue = os_msgQ_find( task );\
80 event = os_msgQ_event_get( queue );\
82 os_posted = os_msg_post( (Msg_t*)&msg, queue, delay, period );\
83 if ( os_posted == MSG_QUEUE_FULL ){\
88 os_posted = MSG_QUEUE_UNDEF;\
91 } while ( os_posted == MSG_QUEUE_FULL );\
92 if ( MSG_QUEUE_POSTED == os_posted ) {\
93 os_signal_event(event);\
94 os_event_set_signaling_tid( event, running_tid );\
100 #define OS_MSG_Q_RECEIVE(task, pMsg, async) do {\
101 static MsgQ_t queue;\
102 static uint8_t os_received;\
104 queue = os_msgQ_find( task );\
105 event = os_msgQ_event_get( queue );\
107 os_received = os_msg_receive( (Msg_t*)pMsg, queue );\
108 if ( os_received == MSG_QUEUE_EMPTY ){\
113 ((Msg_t*)pMsg)->signal = NO_MSG_ID;\
114 os_received = MSG_QUEUE_UNDEF;\
117 } while ( os_received == MSG_QUEUE_EMPTY );\
118 if ( MSG_QUEUE_RECEIVED == os_received) {\
119 os_signal_event(event);\
120 os_event_set_signaling_tid(event, running_tid );\
128 MsgQ_t os_msgQ_create(
Msg_t *buffer, uint8_t nMessages, uint16_t msgSize, taskproctype taskproc );
129 MsgQ_t os_msgQ_find( taskproctype taskproc );
131 Evt_t os_msgQ_event_get( MsgQ_t queue );
132 void os_msgQ_tick( MsgQ_t queue );
134 uint8_t os_msg_post(
Msg_t *msg, MsgQ_t queue, uint16_t delay, uint16_t period );
135 uint8_t os_msg_receive(
Msg_t *msg, MsgQ_t queue );
Definition: os_msgqueue.h:50