Skip to content

Commit 3cfb838

Browse files
committed
fix warnings when enable rtt with rp2040
1 parent 7454e45 commit 3cfb838

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

hw/bsp/rp2040/family.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,12 @@ bool __no_inline_not_in_flash_func(get_bootsel_button)(void) {
9393

9494
static void stdio_rtt_write (const char *buf, int length)
9595
{
96-
SEGGER_RTT_Write(0, buf, length);
96+
SEGGER_RTT_Write(0, buf, (unsigned) length);
9797
}
9898

9999
static int stdio_rtt_read (char *buf, int len)
100100
{
101-
return SEGGER_RTT_Read(0, buf, len);
101+
return (int) SEGGER_RTT_Read(0, buf, (unsigned) len);
102102
}
103103

104104
static stdio_driver_t stdio_rtt =

hw/bsp/rp2040/family.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
127127
target_compile_definitions(tinyusb_additions INTERFACE CFG_TUSB_DEBUG=${LOG})
128128
endif()
129129

130-
if(LOGGER STREQUAL "rtt")
130+
if(LOGGER STREQUAL "RTT" OR LOGGER STREQUAL "rtt")
131131
target_compile_definitions(tinyusb_additions INTERFACE
132132
LOGGER_RTT
133133
SEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
@@ -137,6 +137,10 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
137137
${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
138138
)
139139

140+
set_source_files_properties(${TOP}/lib/SEGGER_RTT/RTT/SEGGER_RTT.c
141+
PROPERTIES
142+
COMPILE_FLAGS "-Wno-cast-qual -Wno-cast-align -Wno-sign-conversion")
143+
140144
target_include_directories(tinyusb_additions INTERFACE
141145
${TOP}/lib/SEGGER_RTT/RTT
142146
)

src/portable/raspberrypi/rp2040/dcd_rp2040.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static void hw_endpoint_xfer(uint8_t ep_addr, uint8_t *buffer, uint16_t total_by
189189
static void __tusb_irq_path_func(hw_handle_buff_status)(void)
190190
{
191191
uint32_t remaining_buffers = usb_hw->buf_status;
192-
pico_trace("buf_status = 0x%08x\n", remaining_buffers);
192+
pico_trace("buf_status = 0x%08lx\n", remaining_buffers);
193193
uint bit = 1u;
194194
for (uint8_t i = 0; remaining_buffers && i < USB_MAX_ENDPOINTS * 2; i++)
195195
{

src/portable/raspberrypi/rp2040/rp2040_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static bool __tusb_irq_path_func(e15_is_critical_frame_period) (struct hw_endpoi
419419
if (delta < 800 || delta > 998) {
420420
return false;
421421
}
422-
TU_LOG(3, "Avoiding sof %u now %lu last %lu\n", (usb_hw->sof_rd + 1) & USB_SOF_RD_BITS, time_us_32(), e15_last_sof);
422+
TU_LOG(3, "Avoiding sof %lu now %lu last %lu\n", (usb_hw->sof_rd + 1) & USB_SOF_RD_BITS, time_us_32(), e15_last_sof);
423423
return true;
424424
}
425425

0 commit comments

Comments
 (0)