Skip to content

Commit 8d3f0ff

Browse files
committed
* don't force dependency on pico-pio-usb submodule
* suppress compiler warning/errors especially in pico-pio-usb * disable use of pico-pio-usb on gcc 11.3+ for now as it doesn't compile
1 parent 792b552 commit 8d3f0ff

File tree

5 files changed

+39
-52
lines changed

5 files changed

+39
-52
lines changed

examples/host/bare_api/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,3 @@ target_include_directories(${PROJECT} PUBLIC
2525
# Configure compilation flags and libraries for the example... see the corresponding function
2626
# in hw/bsp/FAMILY/family.cmake for details.
2727
family_configure_host_example(${PROJECT})
28-
29-
# For rp2040 enable pico-pio-usb
30-
if(FAMILY STREQUAL "rp2040")
31-
family_add_pico_pio_usb(${PROJECT})
32-
33-
# due to warnings from Pico-PIO-USB
34-
target_compile_options(${PROJECT} PUBLIC
35-
-Wno-error=cast-qual
36-
-Wno-error=sign-conversion
37-
-Wno-error=conversion
38-
)
39-
endif()

examples/host/cdc_msc_hid/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,3 @@ target_include_directories(${PROJECT} PUBLIC
2828
# Configure compilation flags and libraries for the example... see the corresponding function
2929
# in hw/bsp/FAMILY/family.cmake for details.
3030
family_configure_host_example(${PROJECT})
31-
32-
# For rp2040 enable pico-pio-usb
33-
if(FAMILY STREQUAL "rp2040")
34-
family_add_pico_pio_usb(${PROJECT})
35-
36-
# due to warnings from Pico-PIO-USB
37-
target_compile_options(${PROJECT} PUBLIC
38-
-Wno-error=cast-qual
39-
-Wno-error=sign-conversion
40-
-Wno-error=conversion
41-
)
42-
endif()

examples/host/hid_controller/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,3 @@ target_include_directories(${PROJECT} PUBLIC
2626
# Configure compilation flags and libraries for the example... see the corresponding function
2727
# in hw/bsp/FAMILY/family.cmake for details.
2828
family_configure_host_example(${PROJECT})
29-
30-
# For rp2040 enable pico-pio-usb
31-
if(FAMILY STREQUAL "rp2040")
32-
family_add_pico_pio_usb(${PROJECT})
33-
34-
# due to warnings from Pico-PIO-USB
35-
target_compile_options(${PROJECT} PUBLIC
36-
-Wno-error=cast-qual
37-
-Wno-error=sign-conversion
38-
-Wno-error=conversion
39-
)
40-
endif()

examples/host/msc_file_explorer/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,3 @@ target_include_directories(${PROJECT} PUBLIC
3232
# in hw/bsp/FAMILY/family.cmake for details.
3333
family_configure_host_example(${PROJECT})
3434

35-
# For rp2040 enable pico-pio-usb
36-
if(FAMILY STREQUAL "rp2040")
37-
family_add_pico_pio_usb(${PROJECT})
38-
39-
# due to warnings from Pico-PIO-USB
40-
target_compile_options(${PROJECT} PUBLIC
41-
-Wno-error=cast-qual
42-
-Wno-error=sign-conversion
43-
-Wno-error=conversion
44-
)
45-
endif()

hw/bsp/rp2040/family.cmake

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,22 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
161161
rp2040_family_configure_example_warnings(${TARGET})
162162
endfunction()
163163

164+
function(family_add_pico_pio_usb TARGET)
165+
target_link_libraries(${TARGET} PUBLIC tinyusb_pico_pio_usb)
166+
endfunction()
167+
164168
function(family_configure_host_example TARGET)
165169
family_configure_target(${TARGET})
166170
target_link_libraries(${TARGET} PUBLIC pico_stdlib tinyusb_host)
167171
rp2040_family_configure_example_warnings(${TARGET})
168-
endfunction()
169172

170-
function(family_add_pico_pio_usb TARGET)
171-
target_link_libraries(${TARGET} PUBLIC tinyusb_pico_pio_usb)
173+
# For rp2040 enable pico-pio-usb
174+
if (TARGET tinyusb_pico_pio_usb)
175+
# code does not compile with GCC 12+
176+
if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3))
177+
family_add_pico_pio_usb(${PROJECT})
178+
endif()
179+
endif()
172180
endfunction()
173181

174182
function(family_configure_dual_usb_example TARGET)
@@ -272,10 +280,36 @@ if (NOT TARGET _rp2040_family_inclusion_marker)
272280
endif()
273281
if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.0)
274282
set_source_files_properties(
275-
${PICO_TINYUSB_PATH}/src/portable/raspberrypi/rp2040/rp2040_usb.c
276-
PROPERTIES
283+
${PICO_TINYUSB_PATH}/lib/fatfs/source/ff.c
277284
COMPILE_FLAGS "-Wno-stringop-overflow -Wno-array-bounds")
278285
endif()
286+
set_source_files_properties(
287+
${PICO_TINYUSB_PATH}/lib/fatfs/source/ff.c
288+
PROPERTIES
289+
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual")
290+
291+
set_source_files_properties(
292+
${PICO_TINYUSB_PATH}/lib/lwip/src/core/tcp_in.c
293+
${PICO_TINYUSB_PATH}/lib/lwip/src/core/tcp_out.c
294+
PROPERTIES
295+
COMPILE_FLAGS "-Wno-conversion")
296+
297+
set_source_files_properties(
298+
${PICO_TINYUSB_PATH}/lib/networking/dnserver.c
299+
${PICO_TINYUSB_PATH}/lib/networking/dhserver.c
300+
${PICO_TINYUSB_PATH}/lib/networking/rndis_reports.c
301+
PROPERTIES
302+
COMPILE_FLAGS "-Wno-conversion -Wno-sign-conversion")
303+
304+
if (TARGET tinyusb_pico_pio_usb)
305+
set_source_files_properties(
306+
${PICO_TINYUSB_PATH}/hw/mcu/raspberry_pi/Pico-PIO-USB/src/pio_usb_device.c
307+
${PICO_TINYUSB_PATH}/hw/mcu/raspberry_pi/Pico-PIO-USB/src/pio_usb.c
308+
${PICO_TINYUSB_PATH}/hw/mcu/raspberry_pi/Pico-PIO-USB/src/pio_usb_host.c
309+
${PICO_TINYUSB_PATH}/src/portable/raspberrypi/pio_usb/hcd_pio_usb.c
310+
PROPERTIES
311+
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual -Wno-attributes")
312+
endif()
279313
endif()
280314
endfunction()
281315
endif()

0 commit comments

Comments
 (0)