From a8961426b03633a150737364e254c191f438ef14 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 19 Oct 2020 12:03:38 -0500 Subject: [PATCH] Invalidate the cache so get_ptt is current https://github.com/Hamlib/Hamlib/issues/422 --- src/rig.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rig.c b/src/rig.c index bf0ada6a7..8c1658838 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5138,14 +5138,15 @@ static int wait_morse_ptt(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: loop#%d until ptt=0, ptt=%d\n", __func__, loops, pttStatus); + elapsed_ms(&rig->state.cache.time_ptt, HAMLIB_ELAPSED_INVALIDATE); retval = rig_get_ptt(rig, vfo, &pttStatus); if (retval != RIG_OK) { return retval; } - - hl_usleep(50 * 1000); + // every 25ms should be short enough + hl_usleep(25 * 1000); ++loops; } while (pttStatus == RIG_PTT_ON && loops <= 600);