From 3eb149ceb7824c89da03f50e9dd8e2c23d8155c9 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 26 Sep 2023 15:24:29 -0400 Subject: [PATCH] usb_canbus: Prioritize local response sending over new host messages Prioritize sending responses back to the host over transmitting new messages from the host. Otherwise, the gs_usb host usb acknowledgments could saturate the usb bandwidth for extended periods. Signed-off-by: Kevin O'Connor --- src/generic/usb_canbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/usb_canbus.c b/src/generic/usb_canbus.c index 9d09adf9e783..a6e7e801719d 100644 --- a/src/generic/usb_canbus.c +++ b/src/generic/usb_canbus.c @@ -244,9 +244,9 @@ usbcan_task(void) // Send any previous echo frames if (host_status) { - if (UsbCan.usb_send_busy) + if (UsbCan.notify_local || UsbCan.usb_send_busy) // Don't send echo frame until other traffic is sent - return; + break; int ret = usb_send_bulk_in(gs, sizeof(*gs)); if (ret < 0) return;