Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions wled00/wled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,15 @@ void WLED::setup()
findWiFi(true); // start scanning for available WiFi-s

// all GPIOs are allocated at this point
#ifdef ARDUINO_USB_CDC_ON_BOOT
// USB CDC means USB D+ D- are used .. pin allocator will always return. force it as enabled instead
serialCanRX = true;
serialCanTX = true;
#else
// use RX/TX as set by the framework - these boards do _not_ have RX=3 and TX=1
serialCanRX = !PinManager::isPinAllocated(hardwareRX); // Serial RX pin (GPIO 3 on ESP32 and ESP8266)
serialCanTX = !PinManager::isPinAllocated(hardwareTX) || PinManager::getPinOwner(hardwareTX) == PinOwner::DebugOut; // Serial TX pin (GPIO 1 on ESP32 and ESP8266)
#endif // ARDUINO_USB_CDC_ON_BOOT

#ifdef WLED_ENABLE_ADALIGHT
//Serial RX (Adalight, Improv, Serial JSON) only possible if GPIO3 unused
Expand Down
4 changes: 3 additions & 1 deletion wled00/wled_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ void sendBytes(){

void handleSerial()
{
if (!(serialCanRX && Serial)) return; // arduino docs: `if (Serial)` indicates whether or not the USB CDC serial connection is open. For all non-USB CDC ports, this will always return true
if (serialCanRX == false) {
return;
}; // arduino docs: `if (Serial)` indicates whether or not the USB CDC serial connection is open. For all non-USB CDC ports, this will always return true

static auto state = AdaState::Header_A;
static uint16_t count = 0;
Expand Down