From 345729421d2b7a19c8f83ffe1a43f5d79855e671 Mon Sep 17 00:00:00 2001 From: Wouter van Gulik Date: Mon, 6 Sep 2021 21:49:09 +0200 Subject: [PATCH] ft817: Only set the VFO after a successful read. --- rigs/yaesu/ft817.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 21b059fe4..03070e487 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -1370,7 +1370,6 @@ static int ft817_send_icmd(RIG *rig, int index, unsigned char *data) static int ft817_get_vfo(RIG *rig, vfo_t *vfo) { unsigned char c; - *vfo = RIG_VFO_B; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); @@ -1379,7 +1378,14 @@ static int ft817_get_vfo(RIG *rig, vfo_t *vfo) return -RIG_EPROTO; } - if ((c & 0x1) == 0) { *vfo = RIG_VFO_A; } + if ((c & 0x1) == 0) + { + *vfo = RIG_VFO_A; + } + else + { + *vfo = RIG_VFO_B; + } return RIG_OK; }