#ifdef'ed debugging.

This commit is contained in:
David E. Tiller 2022-03-18 20:43:45 -04:00
parent c491655edb
commit 7bde86f6fc
2 changed files with 8 additions and 1 deletions

View File

@ -61,9 +61,10 @@
void eotd_to_nmea (unsigned char *eotd, int eotd_len, char *nmea, int nmea_size) void eotd_to_nmea (unsigned char *eotd, int eotd_len, char *nmea, int nmea_size)
{ {
*nmea = '\0';
for (int i = 0; i < eotd_len; i++) { for (int i = 0; i < eotd_len; i++) {
char temp[32]; char temp[32];
snprintf(temp, sizeof(temp), "%d=%02x ", i, eotd[i]); snprintf(temp, sizeof(temp), "%d=%02x ", i, eotd[i]);
strlcpy(nmea, temp, nmea_size); strlcat(nmea, temp, nmea_size);
} }
} }

View File

@ -439,7 +439,9 @@ static void eotd_rec_bit (int chan, int subchan, int slice, int raw, int future_
*/ */
H = &hdlc_state[chan][subchan][slice]; H = &hdlc_state[chan][subchan][slice];
#ifdef DETDEBUG
fprintf(stderr, "chan=%d subchan=%d slice=%d raw=%d\n", chan, subchan, slice, raw); fprintf(stderr, "chan=%d subchan=%d slice=%d raw=%d\n", chan, subchan, slice, raw);
#endif
//dw_printf ("slice %d = %d\n", slice, raw); //dw_printf ("slice %d = %d\n", slice, raw);
// Accumulate most recent 32 bits in MSB-first order. // 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
/* Hack to skip 'dummy' 64th bit */ /* Hack to skip 'dummy' 64th bit */
if (H->olen == 7 && H->frame_len == 7) { if (H->olen == 7 && H->frame_len == 7) {
#ifdef DETDEBUG
fprintf(stderr, "Special case!\n"); fprintf(stderr, "Special case!\n");
#endif
H->eotd_acc <<= 1; H->eotd_acc <<= 1;
H->olen++; H->olen++;
} }
@ -474,7 +478,9 @@ fprintf(stderr, "Special case!\n");
if (H->frame_len == EOTD_MAX_LEN) { // FIXME: look for other places with max length if (H->frame_len == EOTD_MAX_LEN) { // FIXME: look for other places with max length
done = 1; done = 1;
#ifdef DETDEBUG
for (int ii=0; ii < EOTD_MAX_LEN; ii++) {fprintf(stderr, "%02x ", H->frame_buf[ii]); } fprintf(stderr, "\n"); for (int ii=0; ii < EOTD_MAX_LEN; ii++) {fprintf(stderr, "%02x ", H->frame_buf[ii]); } fprintf(stderr, "\n");
#endif
} }
} }
} }