From 0e157106b30b0340b3ee8387c72844bb1bb4efb9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 18 Mar 2011 13:58:03 +0000 Subject: [PATCH] Fixed bug 3219197. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_2.2.x@2826 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chqueues.h | 6 ++++-- readme.txt | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index 9afc39d91..7964298f1 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -141,7 +141,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. @@ -212,7 +213,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. diff --git a/readme.txt b/readme.txt index 1e4064cfd..6d162e115 100644 --- a/readme.txt +++ b/readme.txt @@ -69,6 +69,7 @@ ***************************************************************************** *** 2.2.3 *** +- FIX: Fixed wrong checks in I/O Queues (bug 3219197). - FIX: Fixed invalid assertion in adcConvert() (bug 3205410). - NEW: Improved preemption implementation for the Cortex-M0, now it uses the NMI vector in order to restore the original context. The change makes