From 407b0fcc5414989d6032d845d139fb7b701ddfdc Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Sun, 22 Jan 2023 10:43:58 -0600 Subject: [PATCH] Fix IC7300 5 second sleep during poweron https://github.com/Hamlib/Hamlib/issues/1220 --- rigs/icom/icom.c | 12 ++++++------ rigs/icom/icom.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 3a7001275..76929d4ce 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -6620,7 +6620,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (priv_caps->dualwatch_split) { - int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_MAIN : S_SUB; + int wvfo = tx_vfo & (RIG_VFO_A | RIG_VFO_MAIN) ? S_SUB : S_MAIN; if (RIG_OK != (retval = icom_set_func(rig, RIG_VFO_CURR, RIG_FUNC_DUAL_WATCH, split_sc))) @@ -8020,6 +8020,11 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) priv->serial_USB_echo_off = 1; retval = icom_transaction(rig, C_SET_PWR, pwr_sc, NULL, 0, ackbuf, &ack_len); + if (rig->caps->rig_model == RIG_MODEL_IC7300) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); + sleep(5); // IC7300 is slow to start up -- may need to add more rigs + } // poweron == 0 means never powered -- == 2 means CAT turned off if (priv->poweron == 0 || priv->poweron == 2) @@ -8051,11 +8056,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) if (status == RIG_POWER_ON) // wait for wakeup only { - if (rig->caps->rig_model == RIG_MODEL_IC7300) - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting 5 seconds for rig to wake up\n", __func__); - sleep(5); // IC7300 is slow to start up -- may need to add more rigs - } for (i = 0; i < retry; ++i) // up to 10 attempts { freq_t freq; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a72ba5ed4..6157453c4 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include #endif -#define BACKEND_VER "20230121" +#define BACKEND_VER "20230122" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51)