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