Skip to content

Commit 59af865

Browse files
authored
Merge pull request #6800 from dhalbert/PacketBuffer-ringbuf-size
PacketBuffer ringbuf size
2 parents d13578f + cf1d0e5 commit 59af865

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ports/nrf/common-hal/_bleio/PacketBuffer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ void common_hal_bleio_packet_buffer_construct(
300300
size_t incoming_buffer_size = 0;
301301
uint32_t *incoming_buffer = NULL;
302302
if (incoming) {
303-
incoming_buffer_size = buffer_size * (sizeof(uint16_t) + max_packet_size);
303+
// + 1 needed by ringbuf for empty/full detection.
304+
incoming_buffer_size = buffer_size * (sizeof(uint16_t) + max_packet_size) + 1;
304305
incoming_buffer = m_malloc(incoming_buffer_size, false);
305306
}
306307

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy