Skip to content

Commit 7bde86f

Browse files
committed
#ifdef'ed debugging.
1 parent c491655 commit 7bde86f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Diff for: src/eotd.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@
6161

6262
void eotd_to_nmea (unsigned char *eotd, int eotd_len, char *nmea, int nmea_size)
6363
{
64+
*nmea = '\0';
6465
for (int i = 0; i < eotd_len; i++) {
6566
char temp[32];
6667
snprintf(temp, sizeof(temp), "%d=%02x ", i, eotd[i]);
67-
strlcpy(nmea, temp, nmea_size);
68+
strlcat(nmea, temp, nmea_size);
6869
}
6970
}

Diff for: src/hdlc_rec.c

+6
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,9 @@ static void eotd_rec_bit (int chan, int subchan, int slice, int raw, int future_
439439
*/
440440
H = &hdlc_state[chan][subchan][slice];
441441

442+
#ifdef DETDEBUG
442443
fprintf(stderr, "chan=%d subchan=%d slice=%d raw=%d\n", chan, subchan, slice, raw);
444+
#endif
443445
//dw_printf ("slice %d = %d\n", slice, raw);
444446

445447
// Accumulate most recent 32 bits in MSB-first order.
@@ -460,7 +462,9 @@ fprintf(stderr, "chan=%d subchan=%d slice=%d raw=%d\n", chan, subchan, slice, ra
460462

461463
/* Hack to skip 'dummy' 64th bit */
462464
if (H->olen == 7 && H->frame_len == 7) {
465+
#ifdef DETDEBUG
463466
fprintf(stderr, "Special case!\n");
467+
#endif
464468
H->eotd_acc <<= 1;
465469
H->olen++;
466470
}
@@ -474,7 +478,9 @@ fprintf(stderr, "Special case!\n");
474478

475479
if (H->frame_len == EOTD_MAX_LEN) { // FIXME: look for other places with max length
476480
done = 1;
481+
#ifdef DETDEBUG
477482
for (int ii=0; ii < EOTD_MAX_LEN; ii++) {fprintf(stderr, "%02x ", H->frame_buf[ii]); } fprintf(stderr, "\n");
483+
#endif
478484
}
479485
}
480486
}

0 commit comments

Comments
 (0)