From: Ramakrishnan Muthukrishnan <ram@leastauthority.com>
Date: Fri, 24 Jun 2022 13:24:24 +0000 (+0530)
Subject: toggle for SAT/RSAT buttons
X-Git-Url: https://git.rkrishnan.org/pf/vdrive/(%5B%5E?a=commitdiff_plain;h=bb6c9d118bfed34d506b450b3551fe92a8953ff3;p=pihpsdr.git

toggle for SAT/RSAT buttons
---

diff --git a/actions.c b/actions.c
index 1e73ac2..cf123d8 100644
--- a/actions.c
+++ b/actions.c
@@ -1017,13 +1017,21 @@ int process_action(void *data) {
       break;
     case RSAT:
       if(a->mode==PRESSED) {
-        sat_mode=RSAT_MODE;
+	  if (sat_mode == RSAT_MODE) {
+	      sat_mode=SAT_NONE;
+	  } else {
+	      sat_mode=RSAT_MODE;
+	  }
         g_idle_add(ext_vfo_update, NULL);
       }
       break;
     case SAT:
       if(a->mode==PRESSED) {
-        sat_mode=SAT_MODE;
+	  if (sat_mode == SAT_MODE) {
+	      sat_mode=SAT_NONE;
+	  } else {
+	      sat_mode=SAT_MODE;
+	  }
         g_idle_add(ext_vfo_update, NULL);
       }
       break;