pull/252/head
Michael Black 2020-05-12 12:25:14 -05:00
commit bc8cab13b4
2 zmienionych plików z 88 dodań i 24 usunięć

Wyświetl plik

@ -3976,6 +3976,7 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
if (rig->caps->rig_model == RIG_MODEL_IC910) if (rig->caps->rig_model == RIG_MODEL_IC910)
{ {
<<<<<<< HEAD
ptt_t ptt; ptt_t ptt;
rig_debug(RIG_DEBUG_VERBOSE, "%s: ic910#2\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s: ic910#2\n", __func__);
retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt); retval = rig_get_ptt(rig, RIG_VFO_CURR, &ptt);
@ -3992,6 +3993,19 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
*tx_freq = priv->vfob_freq; *tx_freq = priv->vfob_freq;
return RIG_OK; return RIG_OK;
} }
=======
ptt_t ptt;
rig_debug(RIG_DEBUG_VERBOSE, "%s: ic910#2\n", __func__);
retval = rig_get_ptt(rig,RIG_VFO_CURR,&ptt);
if (retval != RIG_OK) {
return retval;
}
if (ptt) {
rig_debug(RIG_DEBUG_TRACE, "%s: ptt is on so returning last known freq\n", __func__);
*tx_freq = priv->vfob_freq;
return RIG_OK;
}
>>>>>>> 28ce6d0b54b500fc8b7329eed58b725b94690d3d
} }
rig_debug(RIG_DEBUG_VERBOSE, "%s curr_vfo=%s\n", __func__, rig_debug(RIG_DEBUG_VERBOSE, "%s curr_vfo=%s\n", __func__,

Wyświetl plik

@ -2162,9 +2162,15 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|| vfo == RIG_VFO_CURR || vfo == RIG_VFO_CURR
|| vfo == rig->state.current_vfo) || vfo == rig->state.current_vfo)
{ {
retcode = caps->get_ptt(rig, vfo, ptt);
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); if (retcode == RIG_OK)
return caps->get_ptt(rig, vfo, ptt); {
rig->state.cache.ptt = *ptt;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
}
return retcode;
} }
if (!caps->set_vfo) if (!caps->set_vfo)
@ -2188,6 +2194,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{ {
/* return the first error code */ /* return the first error code */
retcode = rc2; retcode = rc2;
rig->state.cache.ptt = *ptt;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
} }
@ -2196,8 +2203,15 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
case RIG_PTT_SERIAL_RTS: case RIG_PTT_SERIAL_RTS:
if (caps->get_ptt) if (caps->get_ptt)
{ {
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = caps->get_ptt(rig, vfo, ptt);
return caps->get_ptt(rig, vfo, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
} }
if (strcmp(rs->pttport.pathname, rs->rigport.pathname) if (strcmp(rs->pttport.pathname, rs->rigport.pathname)
@ -2206,25 +2220,29 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
/* port is closed so assume PTT off */ /* port is closed so assume PTT off */
*ptt = RIG_PTT_OFF; *ptt = RIG_PTT_OFF;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
} }
else else
{ {
retcode = ser_get_rts(&rig->state.pttport, &status); retcode = ser_get_rts(&rig->state.pttport, &status);
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF; *ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
} }
rig->state.cache.ptt = *ptt;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
return retcode; return retcode;
case RIG_PTT_SERIAL_DTR: case RIG_PTT_SERIAL_DTR:
if (caps->get_ptt) if (caps->get_ptt)
{ {
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = caps->get_ptt(rig, vfo, ptt);
return caps->get_ptt(rig, vfo, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
} }
if (strcmp(rs->pttport.pathname, rs->rigport.pathname) if (strcmp(rs->pttport.pathname, rs->rigport.pathname)
@ -2233,46 +2251,78 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
/* port is closed so assume PTT off */ /* port is closed so assume PTT off */
*ptt = RIG_PTT_OFF; *ptt = RIG_PTT_OFF;
rig->state.cache.ptt = *ptt;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
} }
else else
{ {
retcode = ser_get_dtr(&rig->state.pttport, &status); retcode = ser_get_dtr(&rig->state.pttport, &status);
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF; *ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
} }
rig->state.cache.ptt = *ptt;
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
return retcode; return retcode;
case RIG_PTT_PARALLEL: case RIG_PTT_PARALLEL:
if (caps->get_ptt) if (caps->get_ptt)
{ {
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = caps->get_ptt(rig, vfo, ptt);
return caps->get_ptt(rig, vfo, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
} }
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = par_ptt_get(&rig->state.pttport, ptt);
return par_ptt_get(&rig->state.pttport, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
case RIG_PTT_CM108: case RIG_PTT_CM108:
if (caps->get_ptt) if (caps->get_ptt)
{ {
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = caps->get_ptt(rig, vfo, ptt);
return caps->get_ptt(rig, vfo, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
} }
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = cm108_ptt_get(&rig->state.pttport, ptt);
return cm108_ptt_get(&rig->state.pttport, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
case RIG_PTT_GPIO: case RIG_PTT_GPIO:
case RIG_PTT_GPION: case RIG_PTT_GPION:
if (caps->get_ptt) if (caps->get_ptt)
{ {
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); retcode = caps->get_ptt(rig, vfo, ptt);
return caps->get_ptt(rig, vfo, ptt);
if (retcode == RIG_OK)
{
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);
rig->state.cache.ptt = *ptt;
}
return retcode;
} }
elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET); elapsed_ms(&rig->state.cache.time_ptt, ELAPSED_SET);