]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
changed encoder actions for diversity gain and phase
authorJohn Melton G0ORX <john.d.melton@googlemail.com>
Tue, 3 Mar 2020 12:45:53 +0000 (12:45 +0000)
committerJohn Melton G0ORX <john.d.melton@googlemail.com>
Tue, 3 Mar 2020 12:45:53 +0000 (12:45 +0000)
ext.c
ext.h
gpio.c
gpio.h

diff --git a/ext.c b/ext.c
index 34981e016dbce87ad79260998ad09c61a0aae227..4c4f52253e1a1c6b6f55d20b769cd7940019f896 100644 (file)
--- a/ext.c
+++ b/ext.c
@@ -42,6 +42,7 @@
 #include "bandstack.h"
 #include "noise_menu.h"
 #include "wdsp.h"
+#include "ext.h"
 
 // The following calls functions can be called usig g_idle_add
 
@@ -643,3 +644,29 @@ int ext_set_duplex(void *data) {
   setDuplex();
   return 0;
 }
+
+int ext_set_rx_frequency(void *data) {
+  RX_FREQUENCY *p=(RX_FREQUENCY *)data;
+  int b = get_band_from_frequency(p->frequency);
+  if (b != vfo[p->rx].band) {
+    vfo_band_changed(b);
+  }
+  setFrequency(p->frequency);
+  g_free(data);
+  return 0;
+
+  return 0;
+}
+
+int ext_set_rx_mode(void *data) {
+  RX_MODE *p=(RX_MODE *)data;
+  vfo_mode_changed(p->mode);
+  return 0;
+}
+
+int ext_set_rx_filter(void *data) {
+  RX_FILTER *p=(RX_FILTER *)data;
+  vfo_filter_changed(p->filter);
+  return 0;
+}
+
diff --git a/ext.h b/ext.h
index 810be49f0c0e5bb0d929afbd0b64f5949bd28c3c..8860e4c96ef9b7f9b3c1e5287a663a150c4b836d 100644 (file)
--- a/ext.h
+++ b/ext.h
 // Use these calls from within the rigclt daemon, or the GPIO or MIDI stuff
 //
 
+typedef struct _RX_FREQUENCY {
+  int rx;
+  long long frequency;
+} RX_FREQUENCY;
+
+typedef struct _RX_MODE {
+  int rx;
+  int mode;
+} RX_MODE;
+
+typedef struct _RX_FILTER {
+  int rx;
+  int filter;
+} RX_FILTER;
+
 extern int ext_discovery(void *data);
 extern int ext_vfo_update(void *data);
 extern int ext_set_frequency(void *data);
@@ -114,3 +129,7 @@ int ext_update_noise(void *data);
 #ifdef PURESIGNAL
 int ext_start_ps(void *data);
 #endif
+
+int ext_set_rx_frequency(void *data);
+int ext_set_rx_mode(void *data);
+int ext_set_rx_filter(void *data);
diff --git a/gpio.c b/gpio.c
index be0389f3773e06bd3f6659908f000ce80f0aa700..4da17aa83f904b4fe36579a937d5d768327f41c9 100644 (file)
--- a/gpio.c
+++ b/gpio.c
@@ -223,10 +223,8 @@ char *encoder_string[ENCODER_ACTIONS] = {
   "SQUELCH RX1",
   "SQUELCH RX2",
   "COMP",
-  "DIVERSITY GAIN COARSE",
-  "DIVERSITY GAIN FINE",
-  "DIVERSITY PHASE COARSE",
-  "DIVERSITY PHASE FINE"};
+  "DIVERSITY GAIN",
+  "DIVERSITY PHASE"};
 
 char *sw_string[SWITCH_ACTIONS] = {
   "",
@@ -2054,17 +2052,11 @@ static void encoder_changed(int action,int pos) {
       transmitter->compressor_level=(int)value;
       set_compression(transmitter);
       break;
-    case ENCODER_DIVERSITY_GAIN_COARSE:
-      update_diversity_gain_coarse((double)pos);
+    case ENCODER_DIVERSITY_GAIN:
+      update_diversity_gain((double)pos);
       break;
-    case ENCODER_DIVERSITY_GAIN_FINE:
-      update_diversity_gain_fine((double)pos);
-      break;
-    case ENCODER_DIVERSITY_PHASE_COARSE:
-      update_diversity_phase_coarse((double)pos);
-      break;
-    case ENCODER_DIVERSITY_PHASE_FINE:
-      update_diversity_phase_fine((double)pos);
+    case ENCODER_DIVERSITY_PHASE:
+      update_diversity_phase((double)pos);
       break;
   }
 }
diff --git a/gpio.h b/gpio.h
index 536d9e09b9386cba38cc366f6265cdf366d126d6..f90f1887be25499397df35e93630fe327b452e93 100644 (file)
--- a/gpio.h
+++ b/gpio.h
@@ -66,10 +66,8 @@ enum {
   ENCODER_SQUELCH_RX1,
   ENCODER_SQUELCH_RX2,
   ENCODER_COMP,
-  ENCODER_DIVERSITY_GAIN_COARSE,
-  ENCODER_DIVERSITY_GAIN_FINE,
-  ENCODER_DIVERSITY_PHASE_COARSE,
-  ENCODER_DIVERSITY_PHASE_FINE,
+  ENCODER_DIVERSITY_GAIN,
+  ENCODER_DIVERSITY_PHASE,
   ENCODER_ACTIONS
 };