Keep dedicated USB logging quiet hooks out of nRF52 Full images
This commit is contained in:
1 parent
b3df8bfd3f
commit
1f2fcfc449
4 files changed
+39
-3
No files matched your search
@@ -94,7 +94,7 @@ static std::atomic<bool> usb_logging_enabled{true};
|
||||
#endif
|
||||
static std::atomic<bool> usb_logging_preference_known{false};
|
||||
static std::atomic<bool> usb_debug_enabled{false};
|
||||
#if MESH_USB_LOGGING_AVAILABLE
|
||||
#if MESH_USB_LOGGING_AVAILABLE && !defined(MESH_DUAL_CDC_LOGGING)
|
||||
static std::atomic<uint32_t> usb_packet_logging_quiet_until{0};
|
||||
#endif
|
||||
#if MESH_ENABLE_HOST_KISS
|
||||
@@ -1297,7 +1297,7 @@ bool isUsbLoggingEnabled() {
|
||||
return usb_logging_enabled.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
#if MESH_USB_LOGGING_AVAILABLE
|
||||
#if MESH_USB_LOGGING_AVAILABLE && !defined(MESH_DUAL_CDC_LOGGING)
|
||||
void noteUsbConsoleCommand(const char* command) {
|
||||
if (command == nullptr || hasDedicatedUsbLoggingPort() || isUsbLoggingPacketStream()) return;
|
||||
while (*command == ' ' || *command == '\t' || *command == '\r' || *command == '\n') ++command;
|
||||
|
||||
@@ -92,7 +92,13 @@ inline size_t nextUsbLoggingIdentityOffset(size_t current_offset,
|
||||
// protect framed traffic and restores its saved choice after preferences load.
|
||||
bool isUsbLoggingEnabled();
|
||||
void setUsbLoggingEnabled(bool enabled);
|
||||
#if MESH_USB_LOGGING_AVAILABLE
|
||||
#if MESH_USB_LOGGING_AVAILABLE && defined(MESH_DUAL_CDC_LOGGING)
|
||||
// Either the dedicated CDC or explicit packet stream owns capture in these
|
||||
// builds. Both bypass quieting, so no timer or command parser is needed.
|
||||
inline void noteUsbConsoleCommand(const char*) {}
|
||||
inline void resumeUsbPacketLogging() {}
|
||||
inline bool isUsbPacketLoggingAllowed() { return isUsbLoggingEnabled(); }
|
||||
#elif MESH_USB_LOGGING_AVAILABLE
|
||||
// Human console commands pause packet records for five minutes without
|
||||
// changing the saved logging setting, functional replies, or debug output.
|
||||
// Dedicated logging endpoints, explicit packet streams, and stats polls keep
|
||||
|
||||
Reference in new issue
Block a user