Browse Source

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 <[email protected]>
pull/2819/head
ViezeVingertjes 4 weeks ago
parent
commit
3b69e7873b
  1. 4
      examples/kiss_modem/main.cpp

4
examples/kiss_modem/main.cpp

@ -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

Loading…
Cancel
Save