aboutsummaryrefslogtreecommitdiffstats
path: root/src/generic/usb_canbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/generic/usb_canbus.c')
-rw-r--r--src/generic/usb_canbus.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/generic/usb_canbus.c b/src/generic/usb_canbus.c
index 602acc70..9b0bebe6 100644
--- a/src/generic/usb_canbus.c
+++ b/src/generic/usb_canbus.c
@@ -204,20 +204,16 @@ usbcan_task(void)
msg.dlc = gs->can_dlc;
msg.data32[0] = gs->data32[0];
msg.data32[1] = gs->data32[1];
+ if (host_status & HS_TX_LOCAL) {
+ canserial_process_data(&msg);
+ UsbCan.host_status = host_status = host_status & ~HS_TX_LOCAL;
+ }
if (host_status & HS_TX_HW) {
ret = canhw_send(&msg);
if (ret < 0)
return;
UsbCan.host_status = host_status = host_status & ~HS_TX_HW;
}
- if (host_status & HS_TX_LOCAL) {
- ret = canserial_process_data(&msg);
- if (ret < 0) {
- usb_notify_bulk_out();
- return;
- }
- UsbCan.host_status = host_status & ~HS_TX_LOCAL;
- }
continue;
}