Add .bin loop 'debug mode' on -J;

This commit is contained in:
lwvmobile 2024-04-25 16:14:59 -04:00
parent 9da8544408
commit c5b36af672
4 changed files with 19 additions and 4 deletions

View File

@ -588,6 +588,7 @@ typedef struct
unsigned int debug_audio_errorsR;
unsigned int debug_header_errors;
unsigned int debug_header_critical_errors;
int debug_mode; //debug misc things
// Last dibit read
int last_dibit;

View File

@ -948,6 +948,7 @@ initState (dsd_state * state)
state->debug_audio_errorsR = 0;
state->debug_header_errors = 0;
state->debug_header_critical_errors = 0;
state->debug_mode = 0;
state->nxdn_last_ran = -1;
state->nxdn_last_rid = 0;
@ -1694,7 +1695,7 @@ main (int argc, char **argv)
exitflag = 0;
while ((c = getopt (argc, argv, "yhaepPqs:t:v:z:i:o:d:c:g:n:w:B:C:R:f:m:u:x:A:S:M:G:D:L:V:U:YK:b:H:X:NQ:WrlZTF01:2:345:6:7:89Ek:I:")) != -1)
while ((c = getopt (argc, argv, "yhaepPqs:t:v:z:i:o:d:c:g:n:w:B:C:R:f:m:u:x:A:S:M:G:D:L:V:U:YK:b:H:X:NQ:WrlZTF01:2:345:6:7:89Ek:I:J")) != -1)
{
opterr = 0;
switch (c)
@ -1708,8 +1709,8 @@ main (int argc, char **argv)
opts.call_alert = 1;
break;
//Free'd up switches include: I, J, j, n, O, v, y
//all numerals have reclaimed, except for 4 and 0,1 (rc4 enforcement and single key)
//Free'd up switches include: j, O,
//
//make sure to put a colon : after each if they need an argument
//or remove colon if no argument required
@ -1717,6 +1718,12 @@ main (int argc, char **argv)
//NOTE: The 'K' option for single BP key has been swapped to 'b'
//'K' is now used for hexidecimal key.csv imports
//this is a debug option hidden from users, but use it to replay .bin files on loop
case 'J':
state.debug_mode = 1;
fprintf (stderr, "Debug Mode Enabled; \n");
break;
//Specify M17 encoder User Data (CAN, DST, SRC values)
//NOTE: Disabled QPSK settings by borrowing these switches (nobody probalby used them anyways)
case 'M':

View File

@ -2382,6 +2382,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
printw("%s", FM_bannerN[i]);
if (i == 1) printw (" ESC to Menu");
if (i == 2) printw (" 'q' to Quit ");
if (i == 3 && state->debug_mode == 1) printw (" DEBUG MODE!");
if (i == 4 && opts->frame_m17 == 0) printw (" MBElib %s", versionstr);
#ifdef USE_CODEC2
if (i == 4 && opts->frame_m17 == 1) printw (" CODEC2");

View File

@ -658,8 +658,14 @@ getSymbol (dsd_opts * opts, dsd_state * state, int have_sync)
// opts->audio_in_type = 0; //switch to pulse after playback, ncurses terminal can initiate replay if wanted
fclose(opts->symbolfile);
fprintf (stderr, "\nEnd of %s\n", opts->audio_in_dev);
//in debug mode, re-run .bin files over and over (look for memory leaks, etc)
if (state->debug_mode == 1)
{
opts->symbolfile = fopen(opts->audio_in_dev, "r");
opts->audio_in_type = 4; //symbol capture bin files
}
//open pulse input if we are pulse output AND using ncurses terminal
if (opts->audio_out_type == 0 && opts->use_ncurses_terminal == 1)
else if (opts->audio_out_type == 0 && opts->use_ncurses_terminal == 1)
{
opts->audio_in_type = 0; //set input type
openPulseInput(opts); //open pulse input