fifth adjustment to tracelog

This commit is contained in:
iceman1001 2020-05-19 00:46:10 +02:00
commit e46639ee60

View file

@ -300,6 +300,11 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
//--- Draw the data column //--- Draw the data column
char line[18][120] = {{0}}; char line[18][120] = {{0}};
if (data_len == 0) {
sprintf(line[0], "<empty trace - possible error>");
return tracepos;
}
for (int j = 0; j < data_len && j / 18 < 18; j++) { for (int j = 0; j < data_len && j / 18 < 18; j++) {
uint8_t parityBits = parityBytes[j >> 3]; uint8_t parityBits = parityBytes[j >> 3];
@ -345,11 +350,6 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
} }
} }
if (data_len == 0) {
sprintf(line[0], "<empty trace - possible error>");
return tracepos;
}
// Draw the CRC column // Draw the CRC column
const char *crc = (crcStatus == 0 ? "!crc" : (crcStatus == 1 ? " ok " : " ")); const char *crc = (crcStatus == 0 ? "!crc" : (crcStatus == 1 ? " ok " : " "));
@ -442,7 +442,9 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr
if (showWaitCycles && !isResponse && next_record_is_response(tracepos, trace)) { if (showWaitCycles && !isResponse && next_record_is_response(tracepos, trace)) {
uint32_t next_timestamp = *((uint32_t *)(trace + tracepos)); tracelog_hdr_t *next_hdr = (tracelog_hdr_t *)(trace + tracepos);
uint32_t next_timestamp = next_hdr->timestamp;
PrintAndLogEx(NORMAL, " %10u | %10u | %s |fdt (Frame Delay Time): %d", PrintAndLogEx(NORMAL, " %10u | %10u | %s |fdt (Frame Delay Time): %d",
(EndOfTransmissionTimestamp - first_timestamp), (EndOfTransmissionTimestamp - first_timestamp),
(next_timestamp - first_timestamp), (next_timestamp - first_timestamp),