mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-23 17:42:22 +00:00
rp2040: Fixup lib and example compile for LLVM Embedded Toolchain for ARM
This commit is contained in:
parent
34798ff85e
commit
b7fa90e706
@ -413,7 +413,7 @@ void cli_cmd_cat(EmbeddedCli *cli, char *args, void *context)
|
|||||||
{
|
{
|
||||||
for(UINT c = 0; c < count; c++)
|
for(UINT c = 0; c < count; c++)
|
||||||
{
|
{
|
||||||
const char ch = buf[c];
|
const uint8_t ch = buf[c];
|
||||||
if (isprint(ch) || iscntrl(ch))
|
if (isprint(ch) || iscntrl(ch))
|
||||||
{
|
{
|
||||||
putchar(ch);
|
putchar(ch);
|
||||||
|
@ -152,6 +152,9 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
|
|||||||
if (NOT PICO_TINYUSB_NO_EXAMPLE_WARNINGS)
|
if (NOT PICO_TINYUSB_NO_EXAMPLE_WARNINGS)
|
||||||
family_add_default_example_warnings(${TARGET})
|
family_add_default_example_warnings(${TARGET})
|
||||||
endif()
|
endif()
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_compile_options(${TARGET} PRIVATE -Wno-unreachable-code)
|
||||||
|
endif()
|
||||||
suppress_tinyusb_warnings()
|
suppress_tinyusb_warnings()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
@ -172,8 +175,8 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
|
|||||||
|
|
||||||
# For rp2040 enable pico-pio-usb
|
# For rp2040 enable pico-pio-usb
|
||||||
if (TARGET tinyusb_pico_pio_usb)
|
if (TARGET tinyusb_pico_pio_usb)
|
||||||
# code does not compile with GCC 12+
|
# code does not compile with non GCC, or GCC 11.3+
|
||||||
if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3))
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3)
|
||||||
family_add_pico_pio_usb(${PROJECT})
|
family_add_pico_pio_usb(${PROJECT})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -278,7 +281,7 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
|
|||||||
COMPILE_FLAGS "-Wno-conversion")
|
COMPILE_FLAGS "-Wno-conversion")
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
|
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
|
||||||
set_source_files_properties(
|
set_source_files_properties(
|
||||||
${PICO_TINYUSB_PATH}/lib/fatfs/source/ff.c
|
${PICO_TINYUSB_PATH}/lib/fatfs/source/ff.c
|
||||||
COMPILE_FLAGS "-Wno-stringop-overflow -Wno-array-bounds")
|
COMPILE_FLAGS "-Wno-stringop-overflow -Wno-array-bounds")
|
||||||
@ -310,6 +313,17 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
|
|||||||
PROPERTIES
|
PROPERTIES
|
||||||
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual -Wno-attributes")
|
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual -Wno-attributes")
|
||||||
endif()
|
endif()
|
||||||
|
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
set_source_files_properties(
|
||||||
|
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_device.c
|
||||||
|
COMPILE_FLAGS "-Wno-unreachable-code")
|
||||||
|
set_source_files_properties(
|
||||||
|
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_host.c
|
||||||
|
COMPILE_FLAGS "-Wno-unreachable-code-fallthrough")
|
||||||
|
set_source_files_properties(
|
||||||
|
${PICO_TINYUSB_PATH}/lib/fatfs/source/ff.c
|
||||||
|
PROPERTIES
|
||||||
|
COMPILE_FLAGS "-Wno-cast-qual")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
endif()
|
endif()
|
||||||
|
@ -297,7 +297,7 @@ static void __tusb_irq_path_func(dcd_rp2040_irq)(void)
|
|||||||
if ( status & USB_INTS_SETUP_REQ_BITS )
|
if ( status & USB_INTS_SETUP_REQ_BITS )
|
||||||
{
|
{
|
||||||
handled |= USB_INTS_SETUP_REQ_BITS;
|
handled |= USB_INTS_SETUP_REQ_BITS;
|
||||||
uint8_t const * setup = (uint8_t const*) &usb_dpram->setup_packet;
|
uint8_t const * setup = remove_volatile_cast(uint8_t const*, &usb_dpram->setup_packet);
|
||||||
|
|
||||||
// reset pid to both 1 (data and ack)
|
// reset pid to both 1 (data and ack)
|
||||||
reset_ep0_pid();
|
reset_ep0_pid();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user