summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/bsp/samd21/boards/metro_m0_express/board.h2
-rw-r--r--hw/bsp/samd51/boards/metro_m4_express/board.h4
-rw-r--r--src/portable/microchip/samd/dcd_samd.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/hw/bsp/samd21/boards/metro_m0_express/board.h b/hw/bsp/samd21/boards/metro_m0_express/board.h
index b9292b9af..13b7556b0 100644
--- a/hw/bsp/samd21/boards/metro_m0_express/board.h
+++ b/hw/bsp/samd21/boards/metro_m0_express/board.h
@@ -35,7 +35,7 @@
#define LED_PIN 17
#define LED_STATE_ON 1
-// Button
+// Button: D5
#define BUTTON_PIN 15
#define BUTTON_STATE_ACTIVE 0
diff --git a/hw/bsp/samd51/boards/metro_m4_express/board.h b/hw/bsp/samd51/boards/metro_m4_express/board.h
index 9bb5f815e..ab10ae4f8 100644
--- a/hw/bsp/samd51/boards/metro_m4_express/board.h
+++ b/hw/bsp/samd51/boards/metro_m4_express/board.h
@@ -35,8 +35,8 @@
#define LED_PIN 16
#define LED_STATE_ON 1
-// Button
-#define BUTTON_PIN (32+14) // D5
+// Button: D5
+#define BUTTON_PIN (32+14)
#define BUTTON_STATE_ACTIVE 0
// UART
diff --git a/src/portable/microchip/samd/dcd_samd.c b/src/portable/microchip/samd/dcd_samd.c
index 54e8e62d9..526a6fb63 100644
--- a/src/portable/microchip/samd/dcd_samd.c
+++ b/src/portable/microchip/samd/dcd_samd.c
@@ -230,10 +230,12 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
if ( dir == TUSB_DIR_OUT )
{
ep->EPCFG.bit.EPTYPE0 = desc_edpt->bmAttributes.xfer + 1;
+ ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ0 | USB_DEVICE_EPSTATUSCLR_DTGLOUT; // clear stall & dtoggle
ep->EPINTENSET.bit.TRCPT0 = true;
}else
{
ep->EPCFG.bit.EPTYPE1 = desc_edpt->bmAttributes.xfer + 1;
+ ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ1 | USB_DEVICE_EPSTATUSCLR_DTGLIN; // clear stall & dtoggle
ep->EPINTENSET.bit.TRCPT1 = true;
}