diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/mailboxes.h | 4 | ||||
-rw-r--r-- | src/include/queues.h | 36 | ||||
-rw-r--r-- | src/include/semaphores.h | 2 |
3 files changed, 22 insertions, 20 deletions
diff --git a/src/include/mailboxes.h b/src/include/mailboxes.h index 075dd0989..734a71bac 100644 --- a/src/include/mailboxes.h +++ b/src/include/mailboxes.h @@ -27,7 +27,7 @@ #ifndef _MAILBOXES_H_
#define _MAILBOXES_H_
-#if CH_USE_MAILBOXES && CH_USE_SEMAPHORES_TIMEOUT
+#if CH_USE_MAILBOXES
typedef struct {
msg_t *mb_buffer; /**< Pointer to the mailbox buffer.*/
@@ -91,7 +91,7 @@ extern "C" { */
#define chMBPeek(mbp) (*(mbp)->mb_rdptr)
-#endif /* CH_USE_MAILBOXES && CH_USE_SEMAPHORES_TIMEOUT */
+#endif /* CH_USE_MAILBOXES */
#endif /* _MAILBOXES_H_ */
diff --git a/src/include/queues.h b/src/include/queues.h index e031a39f3..886707e7d 100644 --- a/src/include/queues.h +++ b/src/include/queues.h @@ -90,13 +90,17 @@ typedef GenericQueue InputQueue; /** Evaluates to @p TRUE if the specified Input Queue is full. */ #define chIQIsFull(q) (chQSpace(q) >= chQSize(q)) -#if CH_USE_SEMAPHORES_TIMEOUT -/* - * When semaphores timeout is available this API is implemented as a - * special case of the more general chIQGetTimeout(). +/** + * @brief Input queue read. + * @details This function reads a byte value from an input queue. If the queue + * is empty then the calling thread is suspended until a byte arrives + * in the queue. + * + * @param[in] iqp pointer to an @p InputQueue structure + * @return A byte value from the queue or: + * @retval Q_RESET if the queue was reset. */ #define chIQGet(iqp) chIQGetTimeout(iqp, TIME_INFINITE) -#endif /** * @brief Output queue structure. @@ -116,13 +120,19 @@ typedef GenericQueue OutputQueue; /** Evaluates to @p TRUE if the specified Output Queue is full. */ #define chOQIsFull(q) (chQSpace(q) <= 0) -#if CH_USE_SEMAPHORES_TIMEOUT -/* - * When semaphores timeout is available this API is implemented as a - * special case of the more general chOQPutTimeout(). +/** + * @brief Output queue write. + * @details This function writes a byte value to an output queue. If the queue + * is full then the calling thread is suspended until there is space + * in the queue. + * + * @param[in] oqp pointer to an @p OutputQueue structure + * @param[in] b the byte value to be written in the queue + * @return The operation status: + * @retval Q_OK if the operation succeeded. + * @retval Q_RESET if the queue was reset. */ #define chOQPut(oqp, b) chOQPutTimeout(oqp, b, TIME_INFINITE) -#endif #ifdef __cplusplus extern "C" { @@ -130,17 +140,11 @@ extern "C" { void chIQInit(InputQueue *qp, uint8_t *buffer, size_t size, qnotify_t inotify); void chIQResetI(InputQueue *qp); msg_t chIQPutI(InputQueue *qp, uint8_t b); -#if !CH_USE_SEMAPHORES_TIMEOUT - msg_t chIQGet(InputQueue *qp); -#endif msg_t chIQGetTimeout(InputQueue *qp, systime_t timeout); size_t chIQRead(InputQueue *qp, uint8_t *buffer, size_t n); void chOQInit(OutputQueue *queue, uint8_t *buffer, size_t size, qnotify_t onotify); void chOQResetI(OutputQueue *queue); -#if !CH_USE_SEMAPHORES_TIMEOUT - msg_t chOQPut(OutputQueue *queue, uint8_t b); -#endif msg_t chOQPutTimeout(OutputQueue *queue, uint8_t b, systime_t timeout); msg_t chOQGetI(OutputQueue *queue); size_t chOQWrite(OutputQueue *queue, uint8_t *buffer, size_t n); diff --git a/src/include/semaphores.h b/src/include/semaphores.h index acb48f150..10f784ffc 100644 --- a/src/include/semaphores.h +++ b/src/include/semaphores.h @@ -46,10 +46,8 @@ extern "C" { void chSemResetI(Semaphore *sp, cnt_t n);
msg_t chSemWait(Semaphore *sp);
msg_t chSemWaitS(Semaphore *sp);
-#if CH_USE_SEMAPHORES_TIMEOUT
msg_t chSemWaitTimeout(Semaphore *sp, systime_t time);
msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time);
-#endif
void chSemSignal(Semaphore *sp);
void chSemSignalI(Semaphore *sp);
#if CH_USE_SEMSW
|