Skip to content

Commit 73f22e3

Browse files
author
Ben Avison
committed
[rp2040] Wrap GCC pragmas in #ifdef __GNUC__
IAR generates warning Pe161 'unrecognized #pragma'.
1 parent 01edbb8 commit 73f22e3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/portable/raspberrypi/rp2040/rp2040_usb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,19 @@ void rp2040_usb_init(void)
5757
reset_block(RESETS_RESET_USBCTRL_BITS);
5858
unreset_block_wait(RESETS_RESET_USBCTRL_BITS);
5959

60+
#ifdef __GNUC__
6061
// Clear any previous state just in case
6162
#pragma GCC diagnostic push
6263
#pragma GCC diagnostic ignored "-Warray-bounds"
6364
#if __GNUC__ > 6
6465
#pragma GCC diagnostic ignored "-Wstringop-overflow"
66+
#endif
6567
#endif
6668
memset(usb_hw, 0, sizeof(*usb_hw));
6769
memset(usb_dpram, 0, sizeof(*usb_dpram));
70+
#ifdef __GNUC__
6871
#pragma GCC diagnostic pop
72+
#endif
6973

7074
// Mux the controller to the onboard usb phy
7175
usb_hw->muxing = USB_USB_MUXING_TO_PHY_BITS | USB_USB_MUXING_SOFTCON_BITS;

0 commit comments

Comments
 (0)