mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 07:04:01 -06:00
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>
This commit is contained in:
parent
0728c1a8be
commit
d798fae20b
4 changed files with 32 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue