[Console] Prevent long delay when USB-HWCDC is plugged but not used

This commit is contained in:
TD-er
2026-07-20 22:55:00 +02:00
parent 413a22ff8e
commit 406a62421f
2 changed files with 45 additions and 28 deletions
@@ -162,7 +162,7 @@ size_t Port_ESPEasySerial_USB_HWCDC_t::read(uint8_t *buffer,
void Port_ESPEasySerial_USB_HWCDC_t::flush(void)
{
if (isConnected()) {
return _hwcdc_serial->flush();
_hwcdc_serial->flush();
}
}
@@ -190,16 +190,12 @@ size_t Port_ESPEasySerial_USB_HWCDC_t::write(const uint8_t *buffer,
Port_ESPEasySerial_USB_HWCDC_t::operator bool() const
{
if (isConnected()) {
// return usbActive;
return true;
}
return false;
return _hwcdc_serial != nullptr && _hwcdc_serial->isPlugged();
}
void Port_ESPEasySerial_USB_HWCDC_t::setDebugOutput(bool enabled) {
if (_hwcdc_serial != nullptr) {
return _hwcdc_serial->setDebugOutput(enabled);
_hwcdc_serial->setDebugOutput(enabled);
}
}