Skip to content

Commit

Permalink
Merge pull request #787 from pguyot/w34/add-pico-option-to-wait-for-usb
Browse files Browse the repository at this point in the history
Add build-time option for Pico to wait for a USB connection
  • Loading branch information
fadushin authored Aug 26, 2023
2 parents 79236b9 + 64b116c commit 725d2f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/platforms/rp2040/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
option(AVM_DISABLE_SMP "Disable SMP support." OFF)
option(AVM_USE_32BIT_FLOAT "Use 32 bit floats." OFF)
option(AVM_VERBOSE_ABORT "Print module and line number on VM abort" OFF)

option(AVM_WAIT_FOR_USB_CONNECT "Wait for USB connection before starting" OFF)
option(AVM_REBOOT_ON_NOT_OK "Reboot Pico if result is not ok" OFF)

set(
Expand Down
4 changes: 4 additions & 0 deletions src/platforms/rp2040/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ if (AVM_REBOOT_ON_NOT_OK)
target_compile_definitions(AtomVM PRIVATE CONFIG_REBOOT_ON_NOT_OK)
endif()

if (AVM_WAIT_FOR_USB_CONNECT)
target_compile_definitions(AtomVM PRIVATE PICO_STDIO_USB_CONNECT_WAIT_TIMEOUT_MS=-1)
endif()

set(
PLATFORM_LIB_SUFFIX
${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}
Expand Down

0 comments on commit 725d2f4

Please sign in to comment.