diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-30 09:00:50 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-30 09:00:50 +0000 |
commit | c303a8a06e68fb30c082a4f1a4fcc675ff0bd39e (patch) | |
tree | fbaf137ef85a62d1977d14e412409e645fd048ca /src/chqueues.c | |
parent | f6e46bac2e7d9a62b54deac25b09b7f26bee40b1 (diff) | |
download | ChibiOS-c303a8a06e68fb30c082a4f1a4fcc675ff0bd39e.tar.gz ChibiOS-c303a8a06e68fb30c082a4f1a4fcc675ff0bd39e.tar.bz2 ChibiOS-c303a8a06e68fb30c082a4f1a4fcc675ff0bd39e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@121 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chqueues.c')
-rw-r--r-- | src/chqueues.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/chqueues.c b/src/chqueues.c index 88eac2184..d0412598b 100644 --- a/src/chqueues.c +++ b/src/chqueues.c @@ -91,11 +91,10 @@ t_msg chIQGet(Queue *qp) { chSysLock();
- chSemWaitS(&qp->q_sem);
- if (currp->p_rdymsg < RDY_OK) {
+ if (chSemWaitS(&qp->q_sem) < RDY_OK) {
chSysUnlock();
- return currp->p_rdymsg;
+ return Q_RESET;
}
b = *qp->q_rdptr++;
if (qp->q_rdptr >= qp->q_top)
@@ -324,18 +323,17 @@ void chHDQInit(HalfDuplexQueue *qp, BYTE8 *buffer, t_size size, * Reads a byte from the receive queue, if the queue is empty or is in
* transmission mode then the invoking thread is suspended.
* @param qp pointer to a \p HalfDuplexQueue structure
- * @return the byte value
+ * @return the byte value or \p Q_RESET if the queue was reset
*/
t_msg chHDQGetReceive(HalfDuplexQueue *qp) {
BYTE8 b;
chSysLock();
- chSemWaitS(&qp->hdq_isem);
- if (currp->p_rdymsg < RDY_OK) {
+ if (chSemWaitS(&qp->hdq_isem) < RDY_OK) {
chSysUnlock();
- return currp->p_rdymsg;
+ return Q_RESET;
}
/*
* NOTE: The semaphore can be signaled only if the queue is in
|