Skip to content

Commit

Permalink
Fix startup if HAMLIB_KEYER selected and rig is off or disabled at st…
Browse files Browse the repository at this point in the history
…art (#416)

* Fix startup if HAMLIB_KEYER selected and rig is off or disabled at start

Otherwise TLF will abort unconditionally.
  • Loading branch information
dl1jbe committed Jan 7, 2024
1 parent 446ea10 commit 77612ff
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ bool itumult = false; /* to add the ability of ITU zones to be multiplier */
char itustr[3];

bool nopacket = false; /* set if tlf is called with '-n' */
bool no_trx_control = false; /* set if tlf is called with '-r' */
bool trx_control_disabled = false; /* set if tlf is called with '-r' */
bool convert_cabrillo = false; /* set if the arg input is a cabrillo */

int bandweight_points[NBANDS] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0};
Expand Down Expand Up @@ -468,7 +468,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
nopacket = true;
break;
case 'r':
no_trx_control = true; // disable radio control
trx_control_disabled = true; // disable radio control
break;
case 'i':
convert_cabrillo = true;
Expand Down Expand Up @@ -758,7 +758,7 @@ static int databases_load() {

static void hamlib_init() {

if (no_trx_control) {
if (trx_control_disabled) {
trx_control = false;
}

Expand All @@ -780,6 +780,7 @@ static void hamlib_init() {
exit(1);
}
trx_control = false;
trx_control_disabled = true;
showmsg("Disabling rig control!");
sleep(1);
}
Expand Down Expand Up @@ -872,6 +873,11 @@ static void keyer_init() {

if (cwkeyer == HAMLIB_KEYER) {
showmsg("CW-Keyer is Hamlib");
if (trx_control_disabled) {
showmsg("Radio control disabled - no keying!");
sleep(2);
return;
}
if (!trx_control) {
showmsg("Radio control is not activated!!");
sleep(1);
Expand Down

0 comments on commit 77612ff

Please sign in to comment.