From 99c602fde6bdd45fa10f4f17059ff44619789cd0 Mon Sep 17 00:00:00 2001 From: Peter Harper Date: Wed, 23 Oct 2024 14:00:28 +0100 Subject: [PATCH] Fix build issues when RTT is enabled Fixes https://github.com/raspberrypi/pico-examples/issues/565 --- src/rp2_common/pico_stdio_rtt/SEGGER/RTT/SEGGER_RTT.c | 5 +++++ src/rp2_common/pico_stdio_rtt/stdio_rtt.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rp2_common/pico_stdio_rtt/SEGGER/RTT/SEGGER_RTT.c b/src/rp2_common/pico_stdio_rtt/SEGGER/RTT/SEGGER_RTT.c index f35540417..c69fca7d0 100644 --- a/src/rp2_common/pico_stdio_rtt/SEGGER/RTT/SEGGER_RTT.c +++ b/src/rp2_common/pico_stdio_rtt/SEGGER/RTT/SEGGER_RTT.c @@ -78,6 +78,11 @@ Additional information: #include // for memcpy +#ifdef __GNUC__ +#pragma GCC diagnostic ignored "-Wcast-qual" +#pragma GCC diagnostic ignored "-Wcast-align" +#endif + /********************************************************************* * * Configuration, default values diff --git a/src/rp2_common/pico_stdio_rtt/stdio_rtt.c b/src/rp2_common/pico_stdio_rtt/stdio_rtt.c index 2dc75579a..2af1f7028 100644 --- a/src/rp2_common/pico_stdio_rtt/stdio_rtt.c +++ b/src/rp2_common/pico_stdio_rtt/stdio_rtt.c @@ -26,11 +26,11 @@ void stdio_rtt_deinit(void) { } static void stdio_rtt_out_chars(const char *buf, int length) { - SEGGER_RTT_Write(0, buf, length); + SEGGER_RTT_Write(0, buf, (unsigned)length); } static int stdio_rtt_in_chars(char *buf, int length) { - return SEGGER_RTT_Read(0, buf, length); + return (int)SEGGER_RTT_Read(0, buf, (unsigned)length); } stdio_driver_t stdio_rtt = {