From 47326e33d39ac1086cd0c62a10b0a30428033335 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 17 Mar 2011 09:01:09 +0000 Subject: Fixed bug 3219197. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2822 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chqueues.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'os') 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. -- cgit v1.2.3