File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,15 @@ function(family_add_pico_pio_usb TARGET)
183
183
target_link_libraries (${TARGET} PUBLIC tinyusb_pico_pio_usb )
184
184
endfunction ()
185
185
186
+ # since Pico-PIO_USB compiler support may lag, and change from version to version, add a function that pico-sdk/pico-examples
187
+ # can check (if present) in case the user has updated their TinyUSB
188
+ function (is_compiler_supported_by_pico_pio_usb OUTVAR )
189
+ if ((NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" ))
190
+ SET (${OUTVAR} 0 PARENT_SCOPE )
191
+ else ()
192
+ set (${OUTVAR} 1 PARENT_SCOPE )
193
+ endif ()
194
+ endfunction ()
186
195
187
196
function (family_configure_host_example TARGET RTOS )
188
197
family_configure_target (${TARGET} ${RTOS} )
@@ -191,8 +200,9 @@ function(family_configure_host_example TARGET RTOS)
191
200
192
201
# For rp2040 enable pico-pio-usb
193
202
if (TARGET tinyusb_pico_pio_usb )
194
- # code does not compile with non GCC, or GCC 11.3+
195
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11.3 )
203
+ # Pico-PIO-USB does not compile with all pico-sdk supported compilers, so check before enabling it
204
+ is_compiler_supported_by_pico_pio_usb (PICO_PIO_USB_COMPILER_SUPPORTED )
205
+ if (PICO_PIO_USB_COMPILER_SUPPORTED )
196
206
family_add_pico_pio_usb (${PROJECT} )
197
207
endif ()
198
208
endif ()
You can’t perform that action at this time.
0 commit comments