mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
update rp2040 warnings
- remove "-Wno-stringop-overflow -Wno-array-bounds" - skip -Wconversion for gcc 9 and prior - suppress_tinyusb_warnings only when building with gcc 9 and below
This commit is contained in:
parent
83602ea123
commit
898b52be45
@ -55,17 +55,19 @@ int main(void)
|
|||||||
// with Serial0 as all lower case, Serial1 as all upper case
|
// with Serial0 as all lower case, Serial1 as all upper case
|
||||||
static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
|
static void echo_serial_port(uint8_t itf, uint8_t buf[], uint32_t count)
|
||||||
{
|
{
|
||||||
|
uint8_t const case_diff = 'a' - 'A';
|
||||||
|
|
||||||
for(uint32_t i=0; i<count; i++)
|
for(uint32_t i=0; i<count; i++)
|
||||||
{
|
{
|
||||||
if (itf == 0)
|
if (itf == 0)
|
||||||
{
|
{
|
||||||
// echo back 1st port as lower case
|
// echo back 1st port as lower case
|
||||||
if (isupper(buf[i])) buf[i] = (uint8_t) (buf[i] + 'a' - 'A');
|
if (isupper(buf[i])) buf[i] += case_diff;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// echo back 2nd port as upper case
|
// echo back 2nd port as upper case
|
||||||
if (islower(buf[i])) buf[i] = (uint8_t) (buf[i] - 'a' - 'A');
|
if (islower(buf[i])) buf[i] -= case_diff;
|
||||||
}
|
}
|
||||||
|
|
||||||
tud_cdc_n_write_char(itf, buf[i]);
|
tud_cdc_n_write_char(itf, buf[i]);
|
||||||
|
@ -230,7 +230,7 @@ void tud_hid_report_complete_cb(uint8_t instance, uint8_t const* report, uint16_
|
|||||||
(void) instance;
|
(void) instance;
|
||||||
(void) len;
|
(void) len;
|
||||||
|
|
||||||
uint8_t next_report_id = (uint8_t)(report[0] + 1);
|
uint8_t next_report_id = report[0] + 1u;
|
||||||
|
|
||||||
if (next_report_id < REPORT_ID_COUNT)
|
if (next_report_id < REPORT_ID_COUNT)
|
||||||
{
|
{
|
||||||
|
@ -21,5 +21,11 @@ target_compile_options(${PROJECT} PUBLIC
|
|||||||
-Wuninitialized
|
-Wuninitialized
|
||||||
-Wunused
|
-Wunused
|
||||||
-Wredundant-decls
|
-Wredundant-decls
|
||||||
|
)
|
||||||
|
|
||||||
|
# GCC version 9 or prior has a bug with incorrect Wconversion warnings
|
||||||
|
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
|
||||||
|
target_compile_options(${PROJECT} PUBLIC
|
||||||
-Wconversion
|
-Wconversion
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
@ -235,34 +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
|
# This method must be called from the project scope to suppress known warnings in TinyUSB source files
|
||||||
function(suppress_tinyusb_warnings)
|
function(suppress_tinyusb_warnings)
|
||||||
# some of these are pretty silly warnings only occurring in some older GCC versions
|
# some of these are pretty silly warnings only occurring in some older GCC versions 9 or prior
|
||||||
set(CONVERSION_WARNING_FILES
|
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 10.0)
|
||||||
${PICO_TINYUSB_PATH}/src/tusb.c
|
set(CONVERSION_WARNING_FILES
|
||||||
${PICO_TINYUSB_PATH}/src/common/tusb_fifo.c
|
${PICO_TINYUSB_PATH}/src/tusb.c
|
||||||
${PICO_TINYUSB_PATH}/src/device/usbd.c
|
${PICO_TINYUSB_PATH}/src/common/tusb_fifo.c
|
||||||
${PICO_TINYUSB_PATH}/src/device/usbd_control.c
|
${PICO_TINYUSB_PATH}/src/device/usbd.c
|
||||||
${PICO_TINYUSB_PATH}/src/host/usbh.c
|
${PICO_TINYUSB_PATH}/src/device/usbd_control.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_device.c
|
${PICO_TINYUSB_PATH}/src/host/usbh.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_host.c
|
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_device.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/hid/hid_device.c
|
${PICO_TINYUSB_PATH}/src/class/cdc/cdc_host.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/hid/hid_host.c
|
${PICO_TINYUSB_PATH}/src/class/hid/hid_device.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/audio/audio_device.c
|
${PICO_TINYUSB_PATH}/src/class/hid/hid_host.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/dfu/dfu_device.c
|
${PICO_TINYUSB_PATH}/src/class/audio/audio_device.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/dfu/dfu_rt_device.c
|
${PICO_TINYUSB_PATH}/src/class/dfu/dfu_device.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/midi/midi_device.c
|
${PICO_TINYUSB_PATH}/src/class/dfu/dfu_rt_device.c
|
||||||
${PICO_TINYUSB_PATH}/src/class/usbtmc/usbtmc_device.c
|
${PICO_TINYUSB_PATH}/src/class/midi/midi_device.c
|
||||||
${PICO_TINYUSB_PATH}/src/portable/raspberrypi/rp2040/hcd_rp2040.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(
|
foreach(SOURCE_FILE IN LISTS CONVERSION_WARNING_FILES)
|
||||||
${SOURCE_FILE}
|
set_source_files_properties(
|
||||||
PROPERTIES
|
${SOURCE_FILE}
|
||||||
COMPILE_FLAGS "-Wno-conversion")
|
PROPERTIES
|
||||||
endforeach()
|
COMPILE_FLAGS "-Wno-conversion")
|
||||||
set_source_files_properties(
|
endforeach()
|
||||||
${PICO_TINYUSB_PATH}/src/portable/raspberrypi/rp2040/rp2040_usb.c
|
endif()
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "-Wno-stringop-overflow -Wno-array-bounds"
|
|
||||||
)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user