diff --git a/os/hal/src/hal_buffers.c b/os/hal/src/hal_buffers.c index 68c30c5a4..2f4e0339c 100644 --- a/os/hal/src/hal_buffers.c +++ b/os/hal/src/hal_buffers.c @@ -365,14 +365,9 @@ size_t ibqReadTimeout(input_buffers_queue_t *ibqp, uint8_t *bp, if (ibqp->ptr == NULL) { msg_t msg; - /* TIME_IMMEDIATE is a special case, never wait.*/ - if (timeout == TIME_IMMEDIATE) { - osalSysUnlock(); - return r; - } - - /* TIME_INFINITE is handled differently, no deadline.*/ - if (timeout == TIME_INFINITE) { + /* TIME_INFINITE and TIME_IMMEDIATE are handled differently, no + deadline.*/ + if ((timeout == TIME_INFINITE) || (timeout == TIME_IMMEDIATE)) { msg = ibqGetFullBufferTimeoutS(ibqp, timeout); } else { @@ -743,14 +738,9 @@ size_t obqWriteTimeout(output_buffers_queue_t *obqp, const uint8_t *bp, if (obqp->ptr == NULL) { msg_t msg; - /* TIME_IMMEDIATE is a special case, never wait.*/ - if (timeout == TIME_IMMEDIATE) { - osalSysUnlock(); - return w; - } - - /* TIME_INFINITE is handled differently, no deadline.*/ - if (timeout == TIME_INFINITE) { + /* TIME_INFINITE and TIME_IMMEDIATE are handled differently, no + deadline.*/ + if ((timeout == TIME_INFINITE) || (timeout == TIME_IMMEDIATE)) { msg = obqGetEmptyBufferTimeoutS(obqp, timeout); } else { diff --git a/readme.txt b/readme.txt index 136cf3ca8..cd1b26abf 100644 --- a/readme.txt +++ b/readme.txt @@ -76,7 +76,9 @@ - RT: Removed the p_msg field from the thread_t structure saving a msg_t-sized field from the structure. Messages now use a new field into the p_u union. Now synchronous messages are even faster. -- NIL: NIL_CFG_USE_EVENTS not properly checked in NIL (bug #694) +- HAL: Fixed incorrect handling of TIME_IMMEDIATE in the HAL buffer queues + (bug #695)(backported to 16.1.2). +- NIL: Fixed NIL_CFG_USE_EVENTS not properly checked in NIL (bug #694) (backported to 3.0.5 and 16.1.1). - RT: Fixed ISR statistics are not updated from a critical zone in RT (bug #693)(backported to 3.0.5 and 16.1.1).