kopia lustrzana https://github.com/Hamlib/Hamlib
Add a ptt check to ensure ptt is off for FTDX3000 and FTDX5000
Will wait up to 300ms for PTT off to occur Should help prevent trying to set freq while ptt is on https://github.com/Hamlib/Hamlib/issues/639pull/649/head
rodzic
c5b0b97383
commit
04b4b83f15
|
@ -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; }
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue