diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9dad47bcf..8c601c8ab 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -806,13 +806,26 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (is_ftdx3000 || is_ftdx5000) { // we have a few rigs that can't set freq while PTT_ON + // so we'll try a few times to see if we just need to wait a bit + // 3 retries should be about 400ms -- hopefully more than enough ptt_t ptt; + int retry = 3; - if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt))) + do { - ERRMSG(err, "newcat_set_cmd failed"); - RETURNFUNC(err); + if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt))) + { + ERRMSG(err, "newcat_set_cmd failed"); + RETURNFUNC(err); + } + + if (ptt == RIG_PTT_ON) + { + rig_debug(RIG_DEBUG_WARN, "%s: ptt still on...retry#%d\n", __func__, retry); + hl_usleep(100 * 1000); // 100ms pause if ptt still on + } } + while (err == RIG_OK && ptt == RIG_PTT_ON && retry-- > 0); if (ptt) { return RIG_ENTARGET; } } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index f13ca3629..3c7b5e384 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210327" +#define NEWCAT_VER "20210330" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129