]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Don't release PTT automatically in keyer if it had been engaged before.
authorc vw <dl1ycf@darc.de>
Mon, 21 Sep 2020 15:56:46 +0000 (17:56 +0200)
committerc vw <dl1ycf@darc.de>
Mon, 21 Sep 2020 15:56:46 +0000 (17:56 +0200)
iambic.c

index e3aa4f53b188bbd60b41ddf6f55e9dab2b81aefd..f60444d2b45a902498c21d653aa48478679ab8bb 100644 (file)
--- a/iambic.c
+++ b/iambic.c
@@ -335,6 +335,7 @@ static void* keyer_thread(void *arg) {
     int kdelay;
     int old_volume;
     int txmode;
+    int moxbefore;
 
     fprintf(stderr,"keyer_thread  state running= %d\n", running);
     while(running) {
@@ -359,6 +360,10 @@ static void* keyer_thread(void *arg) {
 
        // check mode: to not induce RX/TX transition if not in CW mode
         txmode=get_tx_mode();
+        moxbefore=mox;
+        // Trigger VOX if CAT CW was active and we have interrupted it by hitting a key
+        if (enforce_cw_vox) moxbefore=0;
+
         if (cw_breakin && (txmode == modeCWU || txmode == modeCWL)) {
           //
           // Possibly we are still in a TX/RX transition from the end of the last
@@ -374,8 +379,6 @@ static void* keyer_thread(void *arg) {
           while ((!mox || cw_not_ready) && i-- > 0) usleep(1000L);
           cwvox=(int) cw_keyer_hang_time;
        }
-       // Trigger VOX if CAT CW was active and we have interrupted it by hitting a key
-       if (enforce_cw_vox) cwvox=(int) cw_keyer_hang_time;
 
         key_state = CHECK;
 
@@ -397,7 +400,7 @@ static void* keyer_thread(void *arg) {
                // If CW-vox still hanging, continue "busy-spinning"
                 if (cwvox == 0) {
                    // we have just reduced cwvox from 1 to 0.
-                   g_idle_add(ext_mox_update,(gpointer)(long) 0);
+                   if (!moxbefore) g_idle_add(ext_mox_update,(gpointer)(long) 0);
                } else {
                    key_state=CHECK;
                }