diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-05-28 09:42:59 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-28 11:12:30 -0400 |
commit | d798fae20b1cd87396ea884de737aa7f3e359193 (patch) | |
tree | 607759d9360d7d2e69cf638913f72155586a0d47 /klippy/serialhdl.py | |
parent | 0728c1a8be5f76d62fae79a9adcc998081049f9e (diff) | |
download | kutter-d798fae20b1cd87396ea884de737aa7f3e359193.tar.gz kutter-d798fae20b1cd87396ea884de737aa7f3e359193.tar.xz kutter-d798fae20b1cd87396ea884de737aa7f3e359193.zip |
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 <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialhdl.py')
-rw-r--r-- | klippy/serialhdl.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |