aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
Diffstat (limited to 'os')
-rw-r--r--os/kernel/include/chqueues.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h
index 1913e8bdd..8a00f404d 100644
--- a/os/kernel/include/chqueues.h
+++ b/os/kernel/include/chqueues.h
@@ -134,7 +134,8 @@ typedef GenericQueue InputQueue;
*
* @iclass
*/
-#define chIQIsFullI(iqp) ((bool_t)(chQSpaceI(iqp) >= chQSizeI(iqp)))
+#define chIQIsFullI(iqp) ((bool_t)(((iqp)->q_wrptr == (iqp)->q_rdptr) && \
+ !chIQIsEmptyI(iqp)))
/**
* @brief Input queue read.
@@ -205,7 +206,8 @@ typedef GenericQueue OutputQueue;
*
* @iclass
*/
-#define chOQIsEmptyI(oqp) ((bool_t)(chQSpaceI(oqp) >= chQSizeI(oqp)))
+#define chOQIsEmptyI(oqp) ((bool_t)(((oqp)->q_wrptr == (oqp)->q_rdptr) && \
+ !chOQIsFullI(oqp)))
/**
* @brief Evaluates to @p TRUE if the specified output queue is full.