summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-06-26 17:03:45 +0700
committerhathach <[email protected]>2023-06-26 17:03:45 +0700
commit3cfb838ba7f1f1a12203d36c9cbb615178af2cf7 (patch)
tree632d566c3bfea4ece47f30b38e4cb3eb2f945208 /hw
parent7454e45796b1bf2f3d467694289ef1535f82dab5 (diff)
fix warnings when enable rtt with rp2040
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/rp2040/family.c4
-rw-r--r--hw/bsp/rp2040/family.cmake6
2 files changed, 7 insertions, 3 deletions
diff --git a/hw/bsp/rp2040/family.c b/hw/bsp/rp2040/family.c
index 3aa989c0e..097e6fbd6 100644
--- a/hw/bsp/rp2040/family.c
+++ b/hw/bsp/rp2040/family.c
@@ -93,12 +93,12 @@ bool __no_inline_not_in_flash_func(get_bootsel_button)(void) {
static void stdio_rtt_write (const char *buf, int length)
{
- SEGGER_RTT_Write(0, buf, length);
+ SEGGER_RTT_Write(0, buf, (unsigned) length);
}
static int stdio_rtt_read (char *buf, int len)
{
- return SEGGER_RTT_Read(0, buf, len);
+ return (int) SEGGER_RTT_Read(0, buf, (unsigned) len);
}
static stdio_driver_t stdio_rtt =
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index 28637e3ee..5cf6b1219 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -127,7 +127,7 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
target_compile_definitions(tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG})
endif()
- if(LOGGER STREQUAL "rtt")
+ if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
target_compile_definitions(tinyusb_additions INTERFACE
LOGGER_RTT
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
@@ -137,6 +137,10 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
)
+ set_source_files_properties(${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
+ PROPERTIES
+ COMPILE_FLAGS "-Wno-cast-qual -Wno-cast-align -Wno-sign-conversion")
+
target_include_directories(tinyusb_additions INTERFACE
${TOP}/lib/SEGGER_RTT/RTT
)