Просмотр исходного кода

usb: switch to adafrut's usb stack due to some odd conflict with wifi irq/task

Eric Helgeson 11 месяцев назад
Родитель
Сommit
b0432fea68
2 измененных файлов с 6 добавлено и 4 удалено
  1. 4 4
      lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp
  2. 2 0
      platformio.ini

+ 4 - 4
lib/BlueSCSI_platform_RP2040/BlueSCSI_platform.cpp

@@ -22,7 +22,7 @@
 #endif
 
 #ifndef __MBED__
-# include <SerialUSB.h>
+#include <Adafruit_TinyUSB.h>
 # include <class/cdc/cdc_device.h>
 #else
 # include <platform/mbed_error.h>
@@ -126,6 +126,9 @@ void platform_init()
 {
     // Make sure second core is stopped
     multicore_reset_core1();
+#ifndef __MBED__
+    Serial.begin(115200);
+#endif // __MBED__
 
     // Default debug logging to disabled
     g_log_debug = false;
@@ -290,9 +293,6 @@ void platform_late_init()
         gpio_conf(scsi_pins.IN_RST,    GPIO_FUNC_SIO, true, false, false, true, false);
 
 
-#ifndef __MBED__
-    Serial.begin();
-#endif // __MBED__
 
 #ifdef ENABLE_AUDIO_OUTPUT
         // one-time control setup for DMA channels and second core

+ 2 - 0
platformio.ini

@@ -45,6 +45,8 @@ build_flags =
     -DPICO_DEFAULT_I2C_SDA_PIN=16
     -DPICO_DEFAULT_I2C_SCL_PIN=17
     -DBLUESCSI_NETWORK=1
+; Arduino's default USB task/irq is conflicting with WiFi somehow
+    -DUSE_TINYUSB
 ; build flags mirroring the framework-arduinopico#v4.1.1-DaynaPORT static library build
     -DPICO_CYW43_ARCH_POLL=1
     -DCYW43_LWIP=0