mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 20:55:40 -05:00
Add .bin loop 'debug mode' on -J;
This commit is contained in:
@@ -588,6 +588,7 @@ typedef struct
|
|||||||
unsigned int debug_audio_errorsR;
|
unsigned int debug_audio_errorsR;
|
||||||
unsigned int debug_header_errors;
|
unsigned int debug_header_errors;
|
||||||
unsigned int debug_header_critical_errors;
|
unsigned int debug_header_critical_errors;
|
||||||
|
int debug_mode; //debug misc things
|
||||||
|
|
||||||
// Last dibit read
|
// Last dibit read
|
||||||
int last_dibit;
|
int last_dibit;
|
||||||
|
|||||||
@@ -948,6 +948,7 @@ initState (dsd_state * state)
|
|||||||
state->debug_audio_errorsR = 0;
|
state->debug_audio_errorsR = 0;
|
||||||
state->debug_header_errors = 0;
|
state->debug_header_errors = 0;
|
||||||
state->debug_header_critical_errors = 0;
|
state->debug_header_critical_errors = 0;
|
||||||
|
state->debug_mode = 0;
|
||||||
|
|
||||||
state->nxdn_last_ran = -1;
|
state->nxdn_last_ran = -1;
|
||||||
state->nxdn_last_rid = 0;
|
state->nxdn_last_rid = 0;
|
||||||
@@ -1694,7 +1695,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
exitflag = 0;
|
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;
|
opterr = 0;
|
||||||
switch (c)
|
switch (c)
|
||||||
@@ -1708,8 +1709,8 @@ main (int argc, char **argv)
|
|||||||
opts.call_alert = 1;
|
opts.call_alert = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//Free'd up switches include: I, J, j, n, O, v, y
|
//Free'd up switches include: j, O,
|
||||||
//all numerals have reclaimed, except for 4 and 0,1 (rc4 enforcement and single key)
|
//
|
||||||
|
|
||||||
//make sure to put a colon : after each if they need an argument
|
//make sure to put a colon : after each if they need an argument
|
||||||
//or remove colon if no argument required
|
//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'
|
//NOTE: The 'K' option for single BP key has been swapped to 'b'
|
||||||
//'K' is now used for hexidecimal key.csv imports
|
//'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)
|
//Specify M17 encoder User Data (CAN, DST, SRC values)
|
||||||
//NOTE: Disabled QPSK settings by borrowing these switches (nobody probalby used them anyways)
|
//NOTE: Disabled QPSK settings by borrowing these switches (nobody probalby used them anyways)
|
||||||
case 'M':
|
case 'M':
|
||||||
|
|||||||
@@ -2382,6 +2382,7 @@ ncursesPrinter (dsd_opts * opts, dsd_state * state)
|
|||||||
printw("%s", FM_bannerN[i]);
|
printw("%s", FM_bannerN[i]);
|
||||||
if (i == 1) printw (" ESC to Menu");
|
if (i == 1) printw (" ESC to Menu");
|
||||||
if (i == 2) printw (" 'q' to Quit ");
|
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);
|
if (i == 4 && opts->frame_m17 == 0) printw (" MBElib %s", versionstr);
|
||||||
#ifdef USE_CODEC2
|
#ifdef USE_CODEC2
|
||||||
if (i == 4 && opts->frame_m17 == 1) printw (" CODEC2");
|
if (i == 4 && opts->frame_m17 == 1) printw (" CODEC2");
|
||||||
|
|||||||
@@ -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
|
// opts->audio_in_type = 0; //switch to pulse after playback, ncurses terminal can initiate replay if wanted
|
||||||
fclose(opts->symbolfile);
|
fclose(opts->symbolfile);
|
||||||
fprintf (stderr, "\nEnd of %s\n", opts->audio_in_dev);
|
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
|
//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
|
opts->audio_in_type = 0; //set input type
|
||||||
openPulseInput(opts); //open pulse input
|
openPulseInput(opts); //open pulse input
|
||||||
|
|||||||
Reference in New Issue
Block a user