fix warnings when enable rtt with rp2040

This commit is contained in:
hathach
2023-06-26 17:03:45 +07:00
parent 7454e45796
commit 3cfb838ba7
4 changed files with 9 additions and 5 deletions

View File

@@ -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 =

View File

@@ -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
)