Skip to content

Commit 8a09156

Browse files
committed
restored original condition for serialCanRX in handleSerial()
1 parent 8a26210 commit 8a09156

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

wled00/wled.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ void WLED::setup()
454454

455455
// all GPIOs are allocated at this point
456456
#ifdef ARDUINO_USB_CDC_ON_BOOT
457-
// USB CDC means USB D+ D- are used .. pin allocator will always return. force it as enabled instead
457+
// USB CDC means USB D+ D- are used .. pin allocator will always return false in this case. force it as enabled instead
458458
serialCanRX = true;
459459
serialCanTX = true;
460460
#else

wled00/wled_serial.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ void sendBytes(){
6969

7070
void handleSerial()
7171
{
72-
#if ARDUINO_USB_CDC_ON_BOOT
73-
if (!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
74-
#else
75-
if (!(serialCanRX)) return; // check via pin manager if UART pin is NOT allocated by other function.
76-
#endif
72+
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
7773

7874
static auto state = AdaState::Header_A;
7975
static uint16_t count = 0;

0 commit comments

Comments
 (0)