fix: guard HWCDC serial config behind ARDUINO_USB_MODE

setTxTimeoutMs() and setTxBufferSize() are HWCDC-only APIs; calling
them on HardwareSerial (UART-bridge boards like T-Beam) fails to compile.

Co-Authored-By: Adam Gessaman <adam@gessaman.com>
This commit is contained in:
ViezeVingertjesandAdam Gessaman committed 2026-07-18 22:43:55 +02:00
1 parent 779cd08e54
commit 5614deb63f
1 file changed
+1 -3
+1 -3
View File
@@ -113,11 +113,9 @@ void setup() {
uint32_t start = millis(); uint32_t start = millis();
while (!Serial && millis() - start < 3000) delay(10); while (!Serial && millis() - start < 3000) delay(10);
delay(100); delay(100);
#if defined(ESP32) #if defined(ESP32) && ARDUINO_USB_MODE
Serial.setTxTimeoutMs(USB_TX_TIMEOUT_MS); Serial.setTxTimeoutMs(USB_TX_TIMEOUT_MS);
#if ARDUINO_USB_MODE
Serial.setTxBufferSize(USB_TX_BUFFER_SIZE); Serial.setTxBufferSize(USB_TX_BUFFER_SIZE);
#endif
#endif #endif
modem = new KissModem(Serial, identity, rng, radio_driver, board, sensors); modem = new KissModem(Serial, identity, rng, radio_driver, board, sensors);
#endif #endif