commit | 1142d9c7bb4e6da03a02f45f40c7aab702148776 | [log] [tgz] |
---|---|---|
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | Tue Jun 28 14:16:04 2022 +0200 |
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | Tue Jun 28 19:55:19 2022 +0200 |
tree | 457846e9af891bdf806161f28fe7302840ada515 | |
parent | a349df15d68edc4701f4b3b6a75293b580a6971d [diff] [blame] |
Bug fix for queue capacity calculation Reduce queue capacity by one byte, else it will not be possible to distinguish between an empty and full queue. Change-Id: I872e1eeac31bf2ee8682c1340776d56396c00ff7
diff --git a/applications/message_handler/lib/message_queue.cpp b/applications/message_handler/lib/message_queue.cpp index c3890fe..4001f8c 100644 --- a/applications/message_handler/lib/message_queue.cpp +++ b/applications/message_handler/lib/message_queue.cpp
@@ -48,7 +48,7 @@ } size_t QueueImpl::capacity() const { - return queue.header.size - available(); + return queue.header.size - available() - 1; } bool QueueImpl::read(uint8_t *dst, uint32_t length) {