From 530fc2f44089fc8a96cd68884cdb9c9d9993bd12 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 20 May 2011 19:46:45 +0000 Subject: Change required by a bug into the Cosmic STM8 compiler. This change is a workaround. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2986 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/include/chqueues.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'os/kernel') diff --git a/os/kernel/include/chqueues.h b/os/kernel/include/chqueues.h index d38b25e6f..a2df59dad 100644 --- a/os/kernel/include/chqueues.h +++ b/os/kernel/include/chqueues.h @@ -149,7 +149,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) && \ + ((iqp)->q_counter != 0))) /** * @brief Input queue read. @@ -243,7 +244,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) && \ + ((oqp)->q_counter != 0))) /** * @brief Evaluates to @p TRUE if the specified output queue is full. -- cgit v1.2.3