Skip to content

Commit

Permalink
usb_canbus: Prioritize local response sending over new host messages
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
KevinOConnor committed Sep 26, 2023
1 parent d0f01dd commit 3eb149c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generic/usb_canbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3eb149c

Please sign in to comment.