From fb7c1c27414cf33b1a661c83683d557f096fc7fb Mon Sep 17 00:00:00 2001 From: glitch911 <48015373+glitch911@users.noreply.github.com> Date: Wed, 6 Apr 2022 13:52:31 +0200 Subject: [PATCH] Update uartRingBufDMA.c if (Tail==MainBuf_SIZE) Tail = 0; Must be apply after Tail++ (or always before but all other functions are in this way except getAfter and this could cause crash if another function is called after getAfter and Tail = MainBuf_SIZE, MainBuf[MainBuf_SIZE] crashes --- UART CIRCULAR BUFFER/uartRingBufDMA.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UART CIRCULAR BUFFER/uartRingBufDMA.c b/UART CIRCULAR BUFFER/uartRingBufDMA.c index 5c70dd9..03dcef3 100644 --- a/UART CIRCULAR BUFFER/uartRingBufDMA.c +++ b/UART CIRCULAR BUFFER/uartRingBufDMA.c @@ -259,8 +259,8 @@ int getAfter (char *string, uint8_t numberofchars, char *buffertocopyinto, uint3 HAL_Delay (100); for (int indx=0; indx