Merge pull request #1467 from kilograham/rp2040_cleanup

Minor cleanup of RP2040 code post addition of Pico-PIO-USB
This commit is contained in:
Ha Thach
2022-05-26 23:54:20 +07:00
committed by GitHub
10 changed files with 106 additions and 80 deletions

View File

@@ -537,7 +537,11 @@ bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet
(void) rhport;
// Copy data into setup packet buffer
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
memcpy((void*)&usbh_dpram->setup_packet[0], setup_packet, 8);
#pragma GCC diagnostic pop
// Configure EP0 struct with setup info for the trans complete
struct hw_endpoint *ep = _hw_endpoint_allocate(0);

View File

@@ -58,9 +58,9 @@ 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"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
memset(usb_hw, 0, sizeof(*usb_hw));
memset(usb_dpram, 0, sizeof(*usb_dpram));
#pragma GCC diagnostic pop