aboutsummaryrefslogtreecommitdiffstats
path: root/src/stm32/usbotg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm32/usbotg.c')
-rw-r--r--src/stm32/usbotg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/stm32/usbotg.c b/src/stm32/usbotg.c
index 99837a09..e1c880fb 100644
--- a/src/stm32/usbotg.c
+++ b/src/stm32/usbotg.c
@@ -160,8 +160,8 @@ usb_send_bulk_in(void *data, uint_fast8_t len)
{
uint32_t ctl = EPIN(USB_CDC_EP_BULK_IN)->DIEPCTL;
if (!(ctl & USB_OTG_DIEPCTL_USBAEP))
- // Controller not enabled
- return -2;
+ // Controller not enabled - discard data
+ return len;
if (ctl & USB_OTG_DIEPCTL_EPENA) {
// Wait for space to transmit
OTGD->DIEPEMPMSK |= (1 << USB_CDC_EP_BULK_IN);