Skip to content

Commit

Permalink
Fix kenwood unsupported VFO error for currVFO
Browse files Browse the repository at this point in the history
  • Loading branch information
mdblack98 committed Nov 2, 2021
1 parent 8fe190d commit de1b0f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions rigs/kenwood/kenwood.c
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
unsigned char vfo_function;
split_t tsplit;

rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "%s called %s,%d,%s\n", __func__, rig_strvfo(vfo), split, rig_strvfo(txvfo));

if (RIG_IS_TS990S)
{
Expand All @@ -1257,8 +1257,8 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
RETURNFUNC(kenwood_transaction(rig, cmdbuf, NULL, 0));
}

if (vfo != RIG_VFO_CURR)
{
if (vfo == RIG_VFO_CURR) vfo = rig->state.current_vfo;

switch (vfo)
{
case RIG_VFO_A: vfo_function = '0'; break;
Expand Down Expand Up @@ -1297,7 +1297,6 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
{
RETURNFUNC(retval);
}
}

/* Split off means Rx and Tx are the same */
if (split == RIG_SPLIT_OFF)
Expand All @@ -1315,6 +1314,14 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
}
}

if (txvfo == RIG_VFO_CURR && vfo == RIG_VFO_A) {
if (vfo == RIG_VFO_A) txvfo = RIG_VFO_B;
else if (vfo == RIG_VFO_B) txvfo = RIG_VFO_A;
else {
rig_debug(RIG_DEBUG_ERR, "%s: unsupported split VFO=%s\n", __func__, rig_strvfo(txvfo));
RETURNFUNC(-RIG_EINVAL);
}
}
switch (txvfo)
{
case RIG_VFO_VFO:
Expand Down
2 changes: 1 addition & 1 deletion rigs/kenwood/kenwood.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "token.h"
#include "misc.h"

#define BACKEND_VER "20211028"
#define BACKEND_VER "20211102"

#define EOM_KEN ';'
#define EOM_TH '\r'
Expand Down

0 comments on commit de1b0f5

Please sign in to comment.