Protect ESP32 HWCDC console sessions

This commit is contained in:
mikecarper committed 2026-09-04 17:18:54 -07:00
1 parent 36435b450f
commit b724d19d6f
18 files changed
+196 -104

No files matched your search

+4 -4
View File
@@ -1577,7 +1577,7 @@ void MyMesh::updateFloodAdvertTimer() {
}
void MyMesh::dumpLogFile() {
#if MESH_ESP32_TINYUSB_NONBLOCKING
#if MESH_ESP32_USB_CONSOLE_COOPERATIVE
if (hasPendingSerialOutput()) {
mesh::usbConsolePort().printf("Err - USB output busy\r\n");
return;
@@ -1601,7 +1601,7 @@ void MyMesh::dumpLogFile() {
#endif
}
#if MESH_ESP32_TINYUSB_NONBLOCKING
#if MESH_ESP32_USB_CONSOLE_COOPERATIVE
bool MyMesh::hasPendingSerialOutput() const {
return serial_log_active || serial_log_eof_pending;
}
@@ -2415,7 +2415,7 @@ void MyMesh::handleCommand(uint32_t sender_timestamp, char *command, char *reply
// handled by the role-independent mesh clock synchronizer
} else {
_cli.handleCommand(sender_timestamp, command, reply); // common CLI commands
#if MESH_ESP32_TINYUSB_NONBLOCKING
#if MESH_ESP32_USB_CONSOLE_COOPERATIVE
if (sender_timestamp == 0 && serial_log_eof_pending
&& strcmp(reply, " EOF") == 0) reply[0] = 0;
#endif
@@ -2433,7 +2433,7 @@ void MyMesh::loop() {
// Check radio FIRST to ensure we don't miss incoming packets
// MQTT processing can take time, so we prioritize radio reception
mesh::Mesh::loop();
#if MESH_ESP32_TINYUSB_NONBLOCKING
#if MESH_ESP32_USB_CONSOLE_COOPERATIVE
servicePendingSerialOutput();
#endif
_cli.loop();