diff --git a/hsm2040.h b/hsm2040.h index 026aa11..0bd662d 100644 --- a/hsm2040.h +++ b/hsm2040.h @@ -14,19 +14,19 @@ extern const uint8_t historical_bytes[]; #define DEBUG_PAYLOAD(p,s) { \ - TU_LOG3("Payload %s (%d bytes):\r\n", #p,s);\ + TU_LOG2("Payload %s (%d bytes):\r\n", #p,s);\ for (int i = 0; i < s; i += 16) {\ for (int j = 0; j < 16; j++) {\ - if (j < s-i) TU_LOG3("%02X ",p[i+j]);\ - else TU_LOG3(" ");\ - if (j == 7) TU_LOG3(" ");\ - } TU_LOG3(": "); \ + if (j < s-i) TU_LOG2("%02X ",p[i+j]);\ + else TU_LOG2(" ");\ + if (j == 7) TU_LOG2(" ");\ + } TU_LOG2(": "); \ for (int j = 0; j < MIN(16,s-i); j++) {\ - TU_LOG3("%c",p[i+j]);\ - if (j == 7) TU_LOG3(" ");\ + TU_LOG2("%c",p[i+j] == 0x0a || p[i+j] == 0x0d ? '\\' : p[i+j]);\ + if (j == 7) TU_LOG2(" ");\ }\ - TU_LOG3("\r\n");\ - } TU_LOG3("\r\n"); \ + TU_LOG2("\r\n");\ + } TU_LOG2("\r\n"); \ }