This commit is contained in:
Joe Kearney 2026-01-10 15:59:31 -06:00
parent e62f243e86
commit 3d87f2b530

View file

@ -24,8 +24,10 @@
#include "SystemK.h" #include "SystemK.h"
#define DEBUG_PACKET_ENCODE // Use these defines to enable detailed debug logging of packet encoding and decoding on the PSoC platform.
#define DEBUG_PACKET_DECODE // Debug logging is always available on the ESP32 platform, and can be configured with the console.
//#define PSoC_DEBUG_PACKET_ENCODE
//#define PSoC_DEBUG_PACKET_DECODE
static const char *KLOG_TAG = "Protocols"; static const char *KLOG_TAG = "Protocols";
@ -220,7 +222,7 @@ TimedPulseTrain_T *PROTOCOLS_EncodePacket(TagPacket_T *packet)
break; break;
} }
#ifdef DEBUG_PACKET_ENCODE #if ((defined PSoC_DEBUG_PACKET_ENCODE) || (defined ESP_PLATFORM))
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
if (esp_log_level_get(KLOG_TAG) >= ESP_LOG_DEBUG) if (esp_log_level_get(KLOG_TAG) >= ESP_LOG_DEBUG)
#endif // ESP_PLATFORM #endif // ESP_PLATFORM
@ -228,7 +230,7 @@ TimedPulseTrain_T *PROTOCOLS_EncodePacket(TagPacket_T *packet)
KLOG_DEBUG(KLOG_TAG, "\nEncoded %s packet (%u):", ProtocolNameAsString(packet->protocol), result->count); KLOG_DEBUG(KLOG_TAG, "\nEncoded %s packet (%u):", ProtocolNameAsString(packet->protocol), result->count);
PrintPulseTrainToConsole(result); PrintPulseTrainToConsole(result);
} }
#endif // DEBUG_PACKET_ENCODE #endif // ((defined PSoC_DEBUG_PACKET_ENCODE) || (defined ESP_PLATFORM))
return result; return result;
} }
@ -333,7 +335,7 @@ DecodedPacket_T *PROTOCOLS_MaybeDecodePacket(TimedPulseTrain_T *packet)
result = TEST_MaybeDecodePacket(packet); result = TEST_MaybeDecodePacket(packet);
} }
#ifdef DEBUG_PACKET_DECODE #if ((defined PSoC_DEBUG_PACKET_DECODE) || (defined ESP_PLATFORM))
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
if (esp_log_level_get(KLOG_TAG) >= ESP_LOG_DEBUG) if (esp_log_level_get(KLOG_TAG) >= ESP_LOG_DEBUG)
#endif // ESP_PLATFORM #endif // ESP_PLATFORM
@ -359,7 +361,7 @@ DecodedPacket_T *PROTOCOLS_MaybeDecodePacket(TimedPulseTrain_T *packet)
PrintPulseTrainToConsole(packet); PrintPulseTrainToConsole(packet);
} }
} }
#endif // DEBUG_PACKET_DECODE #endif // ((defined PSoC_DEBUG_PACKET_DECODE) || (defined ESP_PLATFORM))
// Remember which receiver saw the packet. // Remember which receiver saw the packet.
if (result != NULL) if (result != NULL)