From cb0c3c7c20759d376ebc42a3513ff5a78138cd3e Mon Sep 17 00:00:00 2001 From: Solartraveler Date: Thu, 3 Nov 2022 17:26:16 +0100 Subject: [PATCH] STM32L433: Make double buffer work for bulk endpoints in ep_write When using double buffering, data can be send in the USB_EP_TX_VALID state too. --- src/usbd_stm32l433_devfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/usbd_stm32l433_devfs.c b/src/usbd_stm32l433_devfs.c index 133624c..a5def01 100644 --- a/src/usbd_stm32l433_devfs.c +++ b/src/usbd_stm32l433_devfs.c @@ -352,6 +352,7 @@ static int32_t ep_write(uint8_t ep, const void *buf, uint16_t blen) { switch (*reg & (USB_EPTX_STAT | USB_EP_T_FIELD | USB_EP_KIND)) { /* doublebuffered bulk endpoint */ case (USB_EP_TX_NAK | USB_EP_BULK | USB_EP_KIND): + case (USB_EP_TX_VALID | USB_EP_BULK | USB_EP_KIND): if (*reg & USB_EP_SWBUF_TX) { pma_write(buf, blen, &(tbl->tx1)); } else {