summaryrefslogtreecommitdiff
path: root/src/portable/raspberrypi
diff options
context:
space:
mode:
authorhathach <[email protected]>2022-03-20 00:51:00 +0700
committerhathach <[email protected]>2022-03-20 00:51:00 +0700
commit45052c625e962fa908c3234c228fca43181436d6 (patch)
treeebc895fc17fe056108af39e90e8b87ed6b09d895 /src/portable/raspberrypi
parentc0195fc6270394a489faf29fe8fc42dff48bcff1 (diff)
parentae531a79f654d566790a4daae350730cdc0a01e9 (diff)
Merge branch 'master' into pio-host
Diffstat (limited to 'src/portable/raspberrypi')
-rw-r--r--src/portable/raspberrypi/rp2040/hcd_rp2040.c8
-rw-r--r--src/portable/raspberrypi/rp2040/rp2040_usb.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/src/portable/raspberrypi/rp2040/hcd_rp2040.c b/src/portable/raspberrypi/rp2040/hcd_rp2040.c
index 7bbf00efe..5164035aa 100644
--- a/src/portable/raspberrypi/rp2040/hcd_rp2040.c
+++ b/src/portable/raspberrypi/rp2040/hcd_rp2040.c
@@ -329,9 +329,11 @@ static void _hw_endpoint_init(struct hw_endpoint *ep, uint8_t dev_addr, uint8_t
// endpoint number / direction
// preamble
uint32_t reg = dev_addr | (num << USB_ADDR_ENDP1_ENDPOINT_LSB);
- // Assert the interrupt endpoint is IN_TO_HOST
- // TODO Interrupt can also be OUT
- assert(dir == TUSB_DIR_IN);
+
+ if (dir == TUSB_DIR_OUT)
+ {
+ reg |= USB_ADDR_ENDP1_INTEP_DIR_BITS;
+ }
if (need_pre(dev_addr))
{
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c
index 293cefaf6..9c3e5d011 100644
--- a/src/portable/raspberrypi/rp2040/rp2040_usb.c
+++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c
@@ -58,8 +58,12 @@ void rp2040_usb_init(void)
unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
// Clear any previous state just in case
+ // TODO Suppress warning array-bounds with gcc11
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds"
memset(usb_hw, 0, sizeof(*usb_hw));
memset(usb_dpram, 0, sizeof(*usb_dpram));
+#pragma GCC diagnostic pop
// Mux the controller to the onboard usb phy
usb_hw->muxing = USB_USB_MUXING_TO_PHY_BITS | USB_USB_MUXING_SOFTCON_BITS;