Add PTT check in set_freq since rig cannot set freq while transmitting

VOX mode was a problem so this ptt check should fix it.
https://github.com/Hamlib/Hamlib/issues/1052
pull/1068/head
Mike Black W9MDB 2022-06-03 08:11:32 -05:00
rodzic b99e8988e0
commit d12ca22916
1 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -248,7 +248,7 @@ const struct rig_caps ft857_caps =
RIG_MODEL(RIG_MODEL_FT857),
.model_name = "FT-857",
.mfg_name = "Yaesu",
.version = "20220407.0",
.version = "20220603.0",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -936,11 +936,24 @@ int ft857_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
int ft857_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
unsigned char data[YAESU_CMD_LENGTH - 1];
int retval;
int i;
ptt_t ptt = RIG_PTT_ON;
rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "ft857: requested freq = %"PRIfreq" Hz\n", freq);
// cannot set freq while PTT is on
for (i = 0; i < 10 && ptt == RIG_PTT_ON; ++i)
{
retval = rig_get_ptt(rig, vfo, &ptt);
if (retval != RIG_OK) { return retval; }
hl_usleep(100 * 1000);
}
/* fill in the frequency */
to_bcd_be(data, (freq + 5) / 10, 8);