diff options
author | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2022-06-28 14:16:04 +0200 |
---|---|---|
committer | Kristofer Jonsson <kristofer.jonsson@arm.com> | 2022-06-28 19:55:19 +0200 |
commit | 1142d9c7bb4e6da03a02f45f40c7aab702148776 (patch) | |
tree | 457846e9af891bdf806161f28fe7302840ada515 /applications/message_handler | |
parent | a349df15d68edc4701f4b3b6a75293b580a6971d (diff) | |
download | ethos-u-core-platform-1142d9c7bb4e6da03a02f45f40c7aab702148776.tar.gz |
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
Diffstat (limited to 'applications/message_handler')
-rw-r--r-- | applications/message_handler/lib/message_queue.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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::available() const { } 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) { |