summaryrefslogtreecommitdiff
path: root/src/portable
diff options
context:
space:
mode:
authorScott Shawcroft <[email protected]>2022-03-03 16:53:22 -0800
committerScott Shawcroft <[email protected]>2022-03-03 21:53:12 -0800
commit2cd73ca60234748a15b74a2c346778fcb4f4ee61 (patch)
tree1fd657340cc452f608f2477354a3bac8be7d939b /src/portable
parent7c627f58d785334cc701e0c4b3160e7fd573f88e (diff)
Add host string descriptor functions
Plus typo fixes, GCC11 array bounds fix, snprintf for malloc-free debug and pragmas for alignment checks.
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/chipidea/ci_hs/hcd_ci_hs.c1
-rw-r--r--src/portable/ehci/ehci.c3
-rw-r--r--src/portable/ehci/ehci.h4
-rw-r--r--src/portable/raspberrypi/rp2040/rp2040_usb.c3
4 files changed, 9 insertions, 2 deletions
diff --git a/src/portable/chipidea/ci_hs/hcd_ci_hs.c b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
index 0754b477e..221721b0f 100644
--- a/src/portable/chipidea/ci_hs/hcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/hcd_ci_hs.c
@@ -35,6 +35,7 @@
// INCLUDE
//--------------------------------------------------------------------+
#include "common/tusb_common.h"
+#include "host/hcd.h"
#include "portable/ehci/ehci_api.h"
#include "ci_hs_type.h"
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c
index e2d51dc4b..6723e99e9 100644
--- a/src/portable/ehci/ehci.c
+++ b/src/portable/ehci/ehci.c
@@ -189,7 +189,10 @@ static void list_remove_qhd_by_addr(ehci_link_t* list_head, uint8_t dev_addr)
prev = list_next(prev) )
{
// TODO check type for ISO iTD and siTD
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wcast-align"
ehci_qhd_t* qhd = (ehci_qhd_t*) list_next(prev);
+ #pragma GCC diagnostic pop
if ( qhd->dev_addr == dev_addr )
{
// TODO deactive all TD, wait for QHD to inactive before removal
diff --git a/src/portable/ehci/ehci.h b/src/portable/ehci/ehci.h
index c2bee67a5..ff9ae12e7 100644
--- a/src/portable/ehci/ehci.h
+++ b/src/portable/ehci/ehci.h
@@ -101,8 +101,8 @@ typedef struct
// Word 2: qTQ Token
volatile uint32_t ping_err : 1 ; ///< For Highspeed: 0 Out, 1 Ping. Full/Slow used as error indicator
- volatile uint32_t non_hs_split_state : 1 ; ///< Used by HC to track the state of slipt transaction
- volatile uint32_t non_hs_missed_uframe : 1 ; ///< HC misses a complete slip transaction
+ volatile uint32_t non_hs_split_state : 1 ; ///< Used by HC to track the state of split transaction
+ volatile uint32_t non_hs_missed_uframe : 1 ; ///< HC misses a complete split transaction
volatile uint32_t xact_err : 1 ; ///< Error (Timeout, CRC, Bad PID ... )
volatile uint32_t babble_err : 1 ; ///< Babble detected, also set Halted bit to 1
volatile uint32_t buffer_err : 1 ; ///< Data overrun/underrun error
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c
index 293cefaf6..be02493f0 100644
--- a/src/portable/raspberrypi/rp2040/rp2040_usb.c
+++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c
@@ -58,8 +58,11 @@ void rp2040_usb_init(void)
unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
// Clear any previous state just in case
+#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;