diff options
| author | Ben Avison <[email protected]> | 2022-09-12 14:46:26 +0100 |
|---|---|---|
| committer | Ben Avison <[email protected]> | 2022-09-13 18:00:51 +0100 |
| commit | 73f22e31c7a31e9b974e27407b906bbc8cb05a7a (patch) | |
| tree | 6c8a3ba293530be52edc95c61acc56b98ceac855 | |
| parent | 01edbb8af6b22fa213bcbbaccd92c9be5f72b376 (diff) | |
[rp2040] Wrap GCC pragmas in #ifdef __GNUC__
IAR generates warning Pe161 'unrecognized #pragma'.
| -rw-r--r-- | src/portable/raspberrypi/rp2040/rp2040_usb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.c b/src/portable/raspberrypi/rp2040/rp2040_usb.c index 25c013bd2..adb9151f9 100644 --- a/src/portable/raspberrypi/rp2040/rp2040_usb.c +++ b/src/portable/raspberrypi/rp2040/rp2040_usb.c @@ -57,15 +57,19 @@ void rp2040_usb_init(void) reset_block(RESETS_RESET_USBCTRL_BITS); unreset_block_wait(RESETS_RESET_USBCTRL_BITS); +#ifdef __GNUC__ // Clear any previous state just in case #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #if __GNUC__ > 6 #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif +#endif memset(usb_hw, 0, sizeof(*usb_hw)); memset(usb_dpram, 0, sizeof(*usb_dpram)); +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif // Mux the controller to the onboard usb phy usb_hw->muxing = USB_USB_MUXING_TO_PHY_BITS | USB_USB_MUXING_SOFTCON_BITS; |
