From 22542a81b669a13534c6617c1de13595ed31dca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20K=C3=A4berich?= Date: Mon, 31 Oct 2022 22:14:59 +0100 Subject: [PATCH] attempt to restart USB communication --- Software/VNA_embedded/Application/Drivers/USB/usb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Software/VNA_embedded/Application/Drivers/USB/usb.c b/Software/VNA_embedded/Application/Drivers/USB/usb.c index 1c8166b..7cf63f2 100644 --- a/Software/VNA_embedded/Application/Drivers/USB/usb.c +++ b/Software/VNA_embedded/Application/Drivers/USB/usb.c @@ -235,7 +235,9 @@ void usb_init(usbd_recv_callback_t receive_callback) { } bool usb_transmit(const uint8_t *data, uint16_t length) { if(!connection_okay()) { - return false; + // clear buffer and attempt to restart the transfer + data_transmission_active = false; + usb_transmit_fifo_level = 0; } // attempt to add data to fifo if(length > usb_available_buffer()) {