summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-06-29 11:39:05 +0700
committerGitHub <[email protected]>2022-06-29 11:39:05 +0700
commit3681ad2941c0da0cd03d0c36860622dc441457d3 (patch)
treeb16f4c7791aa17fa116b9f0a59ae0c1f43d494b6 /hw
parentc7fce32dffd0d6e6c94f030b037d476e16744153 (diff)
parent898b52be45f476d7062d50fed722d92f0dccf4ae (diff)
Merge pull request #1521 from kilograham/rp2040_warning
Re-add some warning suppression for rp2040
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/rp2040/family.cmake30
1 files changed, 29 insertions, 1 deletions
diff --git a/hw/bsp/rp2040/family.cmake b/hw/bsp/rp2040/family.cmake
index df3a6a91e..530d80fec 100644
--- a/hw/bsp/rp2040/family.cmake
+++ b/hw/bsp/rp2040/family.cmake
@@ -150,11 +150,13 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
function(family_configure_device_example TARGET)
family_configure_target(${TARGET})
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device)
+ suppress_tinyusb_warnings()
endfunction()
function(family_configure_host_example TARGET)
family_configure_target(${TARGET})
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host)
+ suppress_tinyusb_warnings()
endfunction()
function(family_add_pico_pio_usb TARGET)
@@ -165,6 +167,7 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
family_configure_target(${TARGET})
# require tinyusb_pico_pio_usb
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_device tinyusb_host tinyusb_pico_pio_usb )
+ suppress_tinyusb_warnings()
endfunction()
function(check_and_add_pico_pio_usb_support)
@@ -232,6 +235,31 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
# This method must be called from the project scope to suppress known warnings in TinyUSB source files
function(suppress_tinyusb_warnings)
- # there are currently no warnings to suppress, however this function must still exist
+ # some of these are pretty silly warnings only occurring in some older GCC versions 9 or prior
+ if (CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0)
+ set(CONVERSION_WARNING_FILES
+ ${PICO_TINYUSB_PATH}/src/tusb.c
+ ${PICO_TINYUSB_PATH}/src/common/tusb_fifo.c
+ ${PICO_TINYUSB_PATH}/src/device/usbd.c
+ ${PICO_TINYUSB_PATH}/src/device/usbd_control.c
+ ${PICO_TINYUSB_PATH}/src/host/usbh.c
+ ${PICO_TINYUSB_PATH}/src/class/cdc/cdc_device.c
+ ${PICO_TINYUSB_PATH}/src/class/cdc/cdc_host.c
+ ${PICO_TINYUSB_PATH}/src/class/hid/hid_device.c
+ ${PICO_TINYUSB_PATH}/src/class/hid/hid_host.c
+ ${PICO_TINYUSB_PATH}/src/class/audio/audio_device.c
+ ${PICO_TINYUSB_PATH}/src/class/dfu/dfu_device.c
+ ${PICO_TINYUSB_PATH}/src/class/dfu/dfu_rt_device.c
+ ${PICO_TINYUSB_PATH}/src/class/midi/midi_device.c
+ ${PICO_TINYUSB_PATH}/src/class/usbtmc/usbtmc_device.c
+ ${PICO_TINYUSB_PATH}/src/portable/raspberrypi/rp2040/hcd_rp2040.c
+ )
+ foreach(SOURCE_FILE IN LISTS CONVERSION_WARNING_FILES)
+ set_source_files_properties(
+ ${SOURCE_FILE}
+ PROPERTIES
+ COMPILE_FLAGS "-Wno-conversion")
+ endforeach()
+ endif()
endfunction()
endif()