From bfff524bf6af59697171e921ceba3302ca3a4b4a Mon Sep 17 00:00:00 2001 From: Zach Garcia Date: Sat, 30 Mar 2024 22:34:21 -0400 Subject: [PATCH] Fix broken usb device issue --- CMakeLists.txt | 2 +- src/main.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0507265f..41e28de2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ add_compile_options( -Wno-unused-function ) -add_definitions(-DVERBOSE -DDEBUG) +# add_definitions(-DVERBOSE -DDEBUG) # Add source files from src/ set(SOURCES diff --git a/src/main.cpp b/src/main.cpp index b160f841..682c50e1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -13,7 +13,7 @@ */ // Uncomment if you want debug information about signal strength and motor movements -#define DEBUG +// #define DEBUG // #include // #include @@ -23,6 +23,7 @@ #include "data.hpp" #include "formulas.hpp" #include "pico/stdlib.h" +#include "tusb.h" #include "pins.hpp" #include "rfm/pico_hal.h" #include "stepper.h" @@ -72,6 +73,10 @@ uint8_t speed = 60; int main() { stdio_init_all(); + while (!tud_cdc_connected()) { + sleep_ms(500); + } + // Initialize servo servo_init(); servo_clock_auto();