123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- #ifndef CHMSG_H
- #define CHMSG_H
- #if (CH_CFG_USE_MESSAGES == TRUE) || defined(__DOXYGEN__)
- #ifdef __cplusplus
- extern "C" {
- #endif
- msg_t chMsgSend(thread_t *tp, msg_t msg);
- thread_t * chMsgWait(void);
- void chMsgRelease(thread_t *tp, msg_t msg);
- #ifdef __cplusplus
- }
- #endif
- static inline bool chMsgIsPendingI(thread_t *tp) {
- chDbgCheckClassI();
- return (bool)(tp->msgqueue.next != (thread_t *)&tp->msgqueue);
- }
- static inline msg_t chMsgGet(thread_t *tp) {
- chDbgAssert(tp->state == CH_STATE_SNDMSG, "invalid state");
- return tp->u.sentmsg;
- }
- static inline void chMsgReleaseS(thread_t *tp, msg_t msg) {
- chDbgCheckClassS();
- chSchWakeupS(tp, msg);
- }
- #endif
- #endif
|