From d798fae20b1cd87396ea884de737aa7f3e359193 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 28 May 2018 09:42:59 -0400 Subject: serialqueue: Limit message transmission to available receive buffer size If the mcu is using a traditional serial port, then only send a new message block if there is space available in the mcu receive buffer. This should make it significantly less likely that high load on the mcu will result in retransmits. Signed-off-by: Kevin O'Connor --- klippy/serialhdl.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'klippy/serialhdl.py') diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py index 0f9e87a2..0aa477c5 100644 --- a/klippy/serialhdl.py +++ b/klippy/serialhdl.py @@ -90,6 +90,10 @@ class SerialReader: baud_adjust = self.BITS_PER_BYTE / mcu_baud self.ffi_lib.serialqueue_set_baud_adjust( self.serialqueue, baud_adjust) + receive_window = msgparser.get_constant_int('RECEIVE_WINDOW', None) + if receive_window is not None: + self.ffi_lib.serialqueue_set_receive_window( + self.serialqueue, receive_window) def connect_file(self, debugoutput, dictionary, pace=False): self.ser = debugoutput self.msgparser.process_identify(dictionary, decompress=False) -- cgit v1.2.3-70-g09d2