git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8622 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
Giovanni Di Sirio 2015-12-20 10:43:14 +00:00
parent a10028c175
commit 5a1884c287
1 changed files with 4 additions and 2 deletions

View File

@ -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;