]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Added Binaural setting. Fixed new protocol bypass HPF setting.
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sat, 10 Dec 2016 11:39:03 +0000 (11:39 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sat, 10 Dec 2016 11:39:03 +0000 (11:39 +0000)
alex.h
audio_menu.c
new_protocol.c
radio.c
radio.h
wdsp_init.c

diff --git a/alex.h b/alex.h
index ee1ce6682ae4e158f41487af0ab7f0b6baf46ebf..b2e0af6d53920bc47215ac173908f27e267b3650 100644 (file)
--- a/alex.h
+++ b/alex.h
@@ -48,7 +48,7 @@
 #define ALEX_9_5MHZ_HPF        0x00000010
 #define ALEX_6_5MHZ_HPF        0x00000020
 #define ALEX_1_5MHZ_HPF        0x00000040
-#define ALEX_BYPASS_HPF        0x00000800
+#define ALEX_BYPASS_HPF        0x00001000
 
 #define ALEX_6M_PREAMP         0x00000008
 
index bda85d3e8219ca04fa6320c0a51c923ffc0d6708..684bba21e8ff505cb6bc82d60bef29cbecd0712e 100644 (file)
@@ -25,7 +25,9 @@
 #include "new_menu.h"
 #include "audio_menu.h"
 #include "audio.h"
+#include "channel.h"
 #include "radio.h"
+#include "wdsp.h"
 
 static GtkWidget *parent_window=NULL;
 
@@ -45,6 +47,11 @@ static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer dat
   return TRUE;
 }
 
+static void binaural_cb(GtkWidget *widget, gpointer data) {
+  binaural=gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
+  SetRXAPanelBinaural(CHANNEL_RX0, binaural);
+}
+
 static void micboost_cb(GtkWidget *widget, gpointer data) {
   mic_boost=mic_boost==1?0:1;
 }
@@ -144,6 +151,11 @@ void audio_menu(GtkWidget *parent) {
   g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
   gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
 
+  GtkWidget *binaural_b=gtk_check_button_new_with_label("Binaural");
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (binaural_b), binaural);
+  gtk_grid_attach(GTK_GRID(grid),binaural_b,1,0,1,1);
+  g_signal_connect(binaural_b,"toggled",G_CALLBACK(binaural_cb),NULL);
+
   int row=0;
 
   if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL) {
index e4c4f01080326ea3e51e1aea68db6d42cef512f9..f108d940c6a66650242c3d8620c37d753b79c5bc 100644 (file)
@@ -378,7 +378,15 @@ static void new_protocol_high_priority(int run) {
     } else {
       buffer[1401]=band->OCrx;
     }
-// alex HPF filters
+
+
+    long filters=0x00000000;
+
+    if(isTransmitting()) {
+      filters=0x08000000;
+    }
+
+// Alex RX HPF filters
 /*
 if              (frequency <  1800000) HPF <= 6'b100000;        // bypass
 else if (frequency <  6500000) HPF <= 6'b010000;        // 1.5MHz HPF   
@@ -388,15 +396,6 @@ else if (frequency < 20000000) HPF <= 6'b000001;        // 13MHz HPF
 else                                               HPF <= 6'b000010;    // 20MHz HPF
 */
 
-
-
-    long filters=0x00000000;
-
-    if(isTransmitting()) {
-      filters=0x08000000;
-    }
-
-// set HPF
     if(ddsFrequency<1800000L) {
         filters|=ALEX_BYPASS_HPF;
     } else if(ddsFrequency<6500000L) {
@@ -410,7 +409,8 @@ else                                               HPF <= 6'b000010;    // 20MHz
     } else {
         filters|=ALEX_20MHZ_HPF;
     }
-// alex LPF filters
+
+// Alex TX LPF filters
 /*
 if (frequency > 32000000)   LPF <= 7'b0010000;             // > 10m so use 6m LPF^M
 else if (frequency > 22000000) LPF <= 7'b0100000;       // > 15m so use 12/10m LPF^M
diff --git a/radio.c b/radio.c
index a47612967461d174c77568e5a0234b3adfe2594c..c442e75d9d110038227a6e4dc5b8d1c480b5bd68 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -93,6 +93,7 @@ int toolbar_dialog_buttons=1;
 
 double volume=0.2;
 double mic_gain=0.0;
+int binaural=0;
 
 int rx_dither=0;
 int rx_random=0;
@@ -697,6 +698,9 @@ fprintf(stderr,"radioRestoreState: %s\n",property_path);
     value=getProperty("vox_hang");
     if(value) vox_hang=atof(value);
 
+    value=getProperty("binaural");
+    if(value) binaural=atoi(value);
+
     bandRestoreState();
 
     sem_post(&property_sem);
@@ -892,6 +896,9 @@ void radioSaveState() {
     sprintf(value,"%f",vox_hang);
     setProperty("vox_hang",value);
 
+    sprintf(value,"%d",binaural);
+    setProperty("binaural",value);
+
     bandSaveState();
 
     saveProperties(property_path);
diff --git a/radio.h b/radio.h
index 6961fa919110409b323fffe11c747395d0dcddfd..af02e6ae3acca6e4f7fa7bea37a73073b8603fa0 100644 (file)
--- a/radio.h
+++ b/radio.h
@@ -111,6 +111,7 @@ extern int toolbar_dialog_buttons;
 
 extern double volume;
 extern double mic_gain;
+extern int binaural;
 extern int agc;
 extern double agc_gain;
 extern double agc_slope;
index 1b356d5a3f72d6d404f4855d33c373335e41638a..6fafe3c921dc9eae52dbbc75c14c05407a9b43cc 100644 (file)
@@ -243,6 +243,7 @@ static void setupRX(int rx) {
     SetRXASNBARun(rx, snb);
 
     SetRXAPanelGain1(rx, volume);
+    SetRXAPanelBinaural(rx, binaural);
 
     if(enable_rx_equalizer) {
       SetRXAGrphEQ(rx, rx_equalizer);