From 612108066d4195ecd52481e04ae7b480f73a8cb5 Mon Sep 17 00:00:00 2001 From: Knutwurst <36196269+knutwurst@users.noreply.github.com> Date: Tue, 2 Jun 2020 19:18:23 +0200 Subject: [PATCH] Fix ringbuffer in serial connection between Mainboard and Touchscreen. --- Marlin/src/lcd/anycubic_serial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/lcd/anycubic_serial.cpp b/Marlin/src/lcd/anycubic_serial.cpp index cb084925..a63f0ca5 100755 --- a/Marlin/src/lcd/anycubic_serial.cpp +++ b/Marlin/src/lcd/anycubic_serial.cpp @@ -66,7 +66,7 @@ ring_buffer tx_buffer_ajg = {{0}, 0, 0}; inline void store_char(unsigned char c, ring_buffer *buffer) { - int i = (unsigned int)(buffer->head + 1) % SERIAL_BUFFER_SIZE; + unsigned int i = ((unsigned int)(buffer->head + 1)) % SERIAL_BUFFER_SIZE; // if we should be storing the received character into the location // just before the tail (meaning that the head would advance to the