1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/periph_usbdev: TXFE not used any longer

After changing IN EPs also to use XFRC (Transfer Complete) interrupts in non-DMA mode, the TXFE (TX FIFO Empty) interrupt is no longer needed to signal the completion of an IN transfer.
This commit is contained in:
Gunar Schorcht 2023-04-15 16:57:29 +02:00
parent ea776c92b6
commit ee83893496

View File

@ -1041,9 +1041,8 @@ static void _usbdev_init(usbdev_t *dev)
(_global_regs(conf)->GINTSTS & USB_OTG_GINTSTS_CMOD) ? "host"
: "device");
/* Enable interrupts and configure the TX level to interrupt on empty */
_global_regs(conf)->GAHBCFG |= USB_OTG_GAHBCFG_GINT |
USB_OTG_GAHBCFG_TXFELVL;
/* Enable interrupts */
_global_regs(conf)->GAHBCFG |= USB_OTG_GAHBCFG_GINT;
#if defined(MCU_STM32)
/* Unmask the interrupt in the NVIC */
@ -1377,7 +1376,6 @@ static int _usbdev_ep_xmit(usbdev_ep_t *ep, uint8_t *buf, size_t len)
/* Intentionally enabling this before the FIFO is filled, unmasking the
* interrupts after the FIFO is filled doesn't always trigger the ISR */
_device_regs(conf)->DAINTMSK |= 1 << ep->num;
_device_regs(conf)->DIEPEMPMSK |= 1 << ep->num;
_in_regs(conf, ep->num)->DIEPCTL |= USB_OTG_DIEPCTL_CNAK |
USB_OTG_DIEPCTL_EPENA;
@ -1493,9 +1491,6 @@ static void _usbdev_ep_esr(usbdev_ep_t *ep)
_in_regs(conf, ep->num)->DIEPINT = USB_OTG_DIEPINT_XFRC;
usbdev->usbdev.epcb(ep, USBDEV_EVENT_TR_COMPLETE);
}
else if (status & USB_OTG_DIEPINT_TXFE) {
_device_regs(conf)->DIEPEMPMSK &= ~(1 << ep->num);
}
}
else {
uint32_t status = _out_regs(conf, ep->num)->DOEPINT;