aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-12-20 10:43:14 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-12-20 10:43:14 +0000
commit5a1884c287e65b64d35f43d27435b90280f91b1b (patch)
tree5e2b6c35c6980d1e0a8052455c22fd3ec4db65f8 /os
parenta10028c175769e8d7a03c1f0f963b878a83deac1 (diff)
downloadChibiOS-5a1884c287e65b64d35f43d27435b90280f91b1b.tar.gz
ChibiOS-5a1884c287e65b64d35f43d27435b90280f91b1b.tar.bz2
ChibiOS-5a1884c287e65b64d35f43d27435b90280f91b1b.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8622 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/src/hal_buffers.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/os/hal/src/hal_buffers.c b/os/hal/src/hal_buffers.c
index fe23c5ba1..f06392d65 100644
--- a/os/hal/src/hal_buffers.c
+++ b/os/hal/src/hal_buffers.c
@@ -143,7 +143,6 @@ uint8_t *ibqGetFullBufferI(input_buffers_queue_t *ibqp) {
if (ibqIsEmptyI(ibqp)) {
ibqp->ptr = NULL;
- ibqp->top = NULL;
return NULL;
}
@@ -171,6 +170,9 @@ void ibqReleaseBufferI(io_buffers_queue_t *ibqp) {
ibqp->brdptr = ibqp->buffers;
}
+ /* Marked as no more sequentially accessible.*/
+ ibqp->ptr = NULL;
+
/* Notifying the buffer release.*/
if (ibqp->notify != NULL) {
ibqp->notify(ibqp);
@@ -206,6 +208,7 @@ msg_t ibqGetTimeout(input_buffers_queue_t *ibqp, systime_t timeout) {
if (msg < MSG_OK) {
return msg;
}
+ /* Tries to get the buffer, the fields ptr and top are setup inside.*/
(void) ibqGetFullBufferI(ibqp);
}
@@ -217,7 +220,6 @@ msg_t ibqGetTimeout(input_buffers_queue_t *ibqp, systime_t timeout) {
empty in the queue.*/
if (ibqp->ptr == ibqp->top) {
ibqReleaseBufferI(ibqp);
- ibqp->ptr = NULL;
}
return msg;