stm32: Only enable one direction on usbfs double buffered end points

The bulk out endpoint should not be enabled in tx mode, and the bulk
in endpoint should not be enabled in rx mode.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2023-10-04 18:49:46 -04:00
parent 6adff3954b
commit 615db729e7
1 changed files with 2 additions and 2 deletions

View File

@ -342,12 +342,12 @@ usb_reset(void)
ep = USB_CDC_EP_BULK_OUT; ep = USB_CDC_EP_BULK_OUT;
USB_EPR[ep] = (USB_CDC_EP_BULK_OUT | USB_EP_BULK | USB_EP_KIND USB_EPR[ep] = (USB_CDC_EP_BULK_OUT | USB_EP_BULK | USB_EP_KIND
| USB_EP_RX_VALID | USB_EP_TX_NAK | USB_EP_DTOG_TX); | USB_EP_RX_NAK | USB_EP_DTOG_TX);
bulk_out_push_flag = USB_EP_DTOG_TX; bulk_out_push_flag = USB_EP_DTOG_TX;
ep = USB_CDC_EP_BULK_IN; ep = USB_CDC_EP_BULK_IN;
USB_EPR[ep] = (USB_CDC_EP_BULK_IN | USB_EP_BULK | USB_EP_KIND USB_EPR[ep] = (USB_CDC_EP_BULK_IN | USB_EP_BULK | USB_EP_KIND
| USB_EP_RX_NAK | USB_EP_TX_NAK); | USB_EP_TX_NAK);
bulk_in_pop_flag = USB_EP_DTOG_RX; bulk_in_pop_flag = USB_EP_DTOG_RX;
USB->CNTR = USB_CNTR_CTRM | USB_CNTR_RESETM; USB->CNTR = USB_CNTR_CTRM | USB_CNTR_RESETM;