Avoid USB logging enum macro collision

This commit is contained in:
mikecarper committed 2026-08-29 09:47:24 -07:00
1 parent f46262dadc
commit d8543ee7fe
3 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -643,7 +643,7 @@ static void serviceUsbTerminal() {
usb_terminal_discard_line = false;
Serial.print("\r\nUSB logging off; ASCII terminal active\r\n> ");
break;
case mesh::UsbLoggingTerminalAction::NONE:
case mesh::UsbLoggingTerminalAction::NO_ACTION:
break;
}
#endif
+3 -3
View File
@@ -93,7 +93,7 @@ public:
// stream objects. In particular, an active TCP terminal owns the role CLI and
// must not be displaced just because USB logging is enabled.
enum class UsbLoggingTerminalAction : uint8_t {
NONE,
NO_ACTION,
CLAIM_USB,
RETURN_TO_BINARY,
KEEP_ASCII,
@@ -104,13 +104,13 @@ inline UsbLoggingTerminalAction selectUsbLoggingTerminalAction(
bool usb_terminal_active, bool usb_logging_terminal_active,
bool full_companion, bool network_terminal_active) {
if (has_dedicated_logging_port || network_terminal_active) {
return UsbLoggingTerminalAction::NONE;
return UsbLoggingTerminalAction::NO_ACTION;
}
if (logging_enabled) {
return UsbLoggingTerminalAction::CLAIM_USB;
}
if (!usb_terminal_active || !usb_logging_terminal_active) {
return UsbLoggingTerminalAction::NONE;
return UsbLoggingTerminalAction::NO_ACTION;
}
return full_companion ? UsbLoggingTerminalAction::KEEP_ASCII
: UsbLoggingTerminalAction::RETURN_TO_BINARY;
@@ -474,10 +474,10 @@ TEST(SerialModeSwitch, SingleTtyLoggingCannotStealNetworkTerminal) {
using Action = mesh::UsbLoggingTerminalAction;
EXPECT_EQ(mesh::selectUsbLoggingTerminalAction(
false, true, false, false, true, true),
Action::NONE);
Action::NO_ACTION);
EXPECT_EQ(mesh::selectUsbLoggingTerminalAction(
false, true, false, false, false, true),
Action::NONE);
Action::NO_ACTION);
}
TEST(SerialModeSwitch, LoggingClaimsOnlySingleTtyUsb) {
@@ -487,7 +487,7 @@ TEST(SerialModeSwitch, LoggingClaimsOnlySingleTtyUsb) {
Action::CLAIM_USB);
EXPECT_EQ(mesh::selectUsbLoggingTerminalAction(
true, true, false, false, true, false),
Action::NONE);
Action::NO_ACTION);
}
TEST(SerialModeSwitch, LoggingOffRestoresTheBuildDefaultUsbMode) {
@@ -500,7 +500,7 @@ TEST(SerialModeSwitch, LoggingOffRestoresTheBuildDefaultUsbMode) {
Action::KEEP_ASCII);
EXPECT_EQ(mesh::selectUsbLoggingTerminalAction(
false, false, true, false, false, false),
Action::NONE);
Action::NO_ACTION);
}
TEST(SerialModeSwitch, FailedMotaRestoresOnlyItsAsciiOrigin) {