Skip to content

Instantly share code, notes, and snippets.

@elktros
Created March 22, 2021 12:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save elktros/edab87a932f107766bc63930ba9bf98c to your computer and use it in GitHub Desktop.
Raspberry Pi Pico USB Serial CMakeLists
if (TARGET tinyusb_device)
add_executable(hello_usb
hello_usb.c
)
# Pull in our pico_stdlib which aggregates commonly used features
target_link_libraries(hello_usb pico_stdlib)
# enable usb output, disable uart output
pico_enable_stdio_usb(hello_usb 1)
pico_enable_stdio_uart(hello_usb 0)
# create map/bin/hex/uf2 file etc.
pico_add_extra_outputs(hello_usb)
# add url via pico_set_program_url
example_auto_set_url(hello_usb)
elseif(PICO_ON_DEVICE)
message(WARNING "not building hello_usb because TinyUSB submodule is not initialized in the SDK")
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment