Browse Source

R2000: Show debugging for IDLE frames

Suppress repeated IDLE frame
master
Andreas Eversberg 2 months ago
parent
commit
641ba0881f
  1. 14
      src/r2000/r2000.c
  2. 1
      src/r2000/r2000.h

14
src/r2000/r2000.c

@ -1153,7 +1153,7 @@ const char *r2000_get_frame(r2000_t *r2000)
{
frame_t frame;
const char *bits;
int debug = 1;
int last_frame_idle, debug = 1;
r2000->tx_frame_count++;
@ -1165,11 +1165,16 @@ const char *r2000_get_frame(r2000_t *r2000)
frame.sm_power = r2000->sysinfo.sm_power;
frame.taxe = r2000->sysinfo.taxe;
last_frame_idle = r2000->tx_last_frame_idle;
r2000->tx_last_frame_idle = 0;
switch (r2000->state) {
case STATE_IDLE:
case STATE_RECALL_WAIT:
tx_idle(r2000, &frame);
debug = 0;
if (last_frame_idle)
debug = 0;
r2000->tx_last_frame_idle = 1;
break;
case STATE_INSCRIPTION:
tx_inscription(r2000, &frame);
@ -1217,7 +1222,10 @@ const char *r2000_get_frame(r2000_t *r2000)
bits = encode_frame(&frame, debug);
PDEBUG_CHAN(DR2000, DEBUG_DEBUG, "Sending frame %s.\n", r2000_frame_name(frame.message, REL_TO_SM));
if (debug)
PDEBUG_CHAN(DR2000, DEBUG_DEBUG, "Sending frame %s.\n", r2000_frame_name(frame.message, REL_TO_SM));
if (debug && r2000->tx_last_frame_idle)
PDEBUG_CHAN(DR2000, DEBUG_DEBUG, "Subsequent IDLE frames are not show, to prevent flooding the output.\n");
return bits;
}

1
src/r2000/r2000.h

@ -90,6 +90,7 @@ typedef struct r2000 {
char tx_frame[208]; /* carries bits of one frame to transmit */
int tx_frame_length;
int tx_frame_pos;
int tx_last_frame_idle; /* indicator to prevent debugging all idle frames */
uint16_t rx_sync; /* shift register to detect sync */
int rx_in_sync; /* if we are in sync and receive bits */
int rx_mute; /* mute count down after sync */

Loading…
Cancel
Save