]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
fixed TX ANT 1 bug. Fixed filter change in CTUN. Fixed step over center in CTUN....
authorJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sun, 4 Dec 2016 14:47:12 +0000 (14:47 +0000)
committerJohn Melton - G0ORX/N6LYT <john.d.melton@googlemail.com>
Sun, 4 Dec 2016 14:47:12 +0000 (14:47 +0000)
12 files changed:
Makefile
ant_menu.c
main.c
meter.c
new_menu.c
radio.c
rigctl.c
sliders.c
sliders.h
test_menu.c [new file with mode: 0644]
test_menu.h [new file with mode: 0644]
wdsp_init.c

index 5e03aea79f77abc60d95874bd80e47a4ed52a2dc..57fa9d6b30b05ae78343c53020c16cd106112d1a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -143,6 +143,7 @@ filter_menu.c \
 noise_menu.c \
 agc_menu.c \
 fm_menu.c \
+test_menu.c \
 rit.c \
 meter.c \
 mode.c \
@@ -198,6 +199,7 @@ filter_menu.h \
 noise_menu.h \
 agc_menu.h \
 fm_menu.h \
+test_menu.h \
 rit.h \
 meter.h \
 mode.h \
@@ -250,6 +252,7 @@ filter_menu.o \
 noise_menu.o \
 agc_menu.o \
 fm_menu.o \
+test_menu.o \
 rit.o \
 meter.o \
 mode.o \
index 9e2af14b6768ea267fb31d0ba1d02e3695419c52..de36b4c1f412e0999fc32bd9efaafd461bff39a4 100644 (file)
@@ -203,6 +203,7 @@ void ant_menu(GtkWidget *parent) {
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tx1_b), band->alexTxAntenna==0);
         gtk_widget_show(tx1_b);
         gtk_grid_attach(GTK_GRID(grid),tx1_b,8,i+2,1,1);
+        g_signal_connect(tx1_b,"pressed",G_CALLBACK(tx_ant_cb),(gpointer)((i<<4)+0));
   
         GtkWidget *tx2_b=gtk_radio_button_new_from_widget(GTK_RADIO_BUTTON(tx1_b));
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tx2_b), band->alexTxAntenna==1);
diff --git a/main.c b/main.c
index 443ad5f7121cb04918feafcd21376801a59cf8a0..084b20ade54e7846286114d67435dc2976e8ea76 100644 (file)
--- a/main.c
+++ b/main.c
 #include "psk_waterfall.h"
 #endif
 
-#define VFO_HEIGHT ((display_height/32)*4)
+//#define VFO_HEIGHT ((display_height/32)*4)
+#define VFO_HEIGHT ((display_height/32)*6)
 #define VFO_WIDTH ((display_width/32)*16)
 #define MENU_HEIGHT VFO_HEIGHT
-//#define MENU_WIDTH ((display_width/32)*3)
 #define MENU_WIDTH ((display_width/32)*8)
 #define RIT_WIDTH ((MENU_WIDTH/3)*2)
 #define METER_HEIGHT VFO_HEIGHT
-//#define METER_WIDTH ((display_width/32)*13)
 #define METER_WIDTH ((display_width/32)*8)
 #define PANADAPTER_HEIGHT ((display_height/32)*8)
 #define SLIDERS_HEIGHT ((display_height/32)*6)
@@ -536,6 +535,11 @@ fprintf(stderr,"%p protocol=%d name=%s\n",d,d->protocol,d->name);
       }
 }
 
+static gboolean minimize_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+  gtk_window_iconify(GTK_WINDOW(window));
+  return TRUE;
+}
+
 static void start_radio() {
   int y;
 fprintf(stderr,"start: selected radio=%p device=%d\n",radio,radio->device);
@@ -612,7 +616,6 @@ fprintf(stderr,"start: selected radio=%p device=%d\n",radio,radio->device);
   gtk_container_add(GTK_CONTAINER(window), fixed);
   y=0;
 
-fprintf(stderr,"vfo_height=%d\n",VFO_HEIGHT);
   vfo = vfo_init(VFO_WIDTH,VFO_HEIGHT,window);
   gtk_fixed_put(GTK_FIXED(fixed),vfo,0,0);
 
@@ -621,12 +624,17 @@ fprintf(stderr,"vfo_height=%d\n",VFO_HEIGHT);
   rit_control = rit_init(RIT_WIDTH,MENU_HEIGHT,window);
   gtk_fixed_put(GTK_FIXED(fixed),rit_control,VFO_WIDTH,y);
 
-fprintf(stderr,"menu_height=%d\n",MENU_HEIGHT);
+  GtkWidget *minimize_b=gtk_button_new_with_label("Hide");
+  gtk_widget_override_font(minimize_b, pango_font_description_from_string("FreeMono Bold 10"));
+  gtk_widget_set_size_request (minimize_b, MENU_WIDTH-RIT_WIDTH, MENU_HEIGHT/2);
+  g_signal_connect (minimize_b, "button-press-event", G_CALLBACK(minimize_cb), NULL);
+  gtk_widget_show(minimize_b);
+  gtk_fixed_put(GTK_FIXED(fixed),minimize_b,VFO_WIDTH+((MENU_WIDTH/3)*2),y);
+
   //menu = menu_init(MENU_WIDTH,MENU_HEIGHT,window);
-  menu = new_menu_init(MENU_WIDTH-RIT_WIDTH,MENU_HEIGHT,window);
-  gtk_fixed_put(GTK_FIXED(fixed),menu,VFO_WIDTH+((MENU_WIDTH/3)*2),y);
+  menu = new_menu_init(MENU_WIDTH-RIT_WIDTH,MENU_HEIGHT/2,window);
+  gtk_fixed_put(GTK_FIXED(fixed),menu,VFO_WIDTH+((MENU_WIDTH/3)*2),y+(MENU_HEIGHT/2));
 
-fprintf(stderr,"meter_height=%d\n",METER_HEIGHT);
   meter = meter_init(METER_WIDTH,METER_HEIGHT,window);
   gtk_fixed_put(GTK_FIXED(fixed),meter,VFO_WIDTH+MENU_WIDTH,y);
   y+=VFO_HEIGHT;
@@ -646,7 +654,6 @@ fprintf(stderr,"meter_height=%d\n",METER_HEIGHT);
         height+=SLIDERS_HEIGHT/2;
       }
     }
-fprintf(stderr,"panadapter_height=%d\n",height);
     panadapter = panadapter_init(display_width,height);
     gtk_fixed_put(GTK_FIXED(fixed),panadapter,0,VFO_HEIGHT);
     y+=height;
@@ -667,7 +674,6 @@ fprintf(stderr,"panadapter_height=%d\n",height);
     if(!display_toolbar) {
       height+=TOOLBAR_HEIGHT;
     }
-fprintf(stderr,"waterfall_height=%d\n",height);
     waterfall = waterfall_init(display_width,height);
     gtk_fixed_put(GTK_FIXED(fixed),waterfall,0,y);
     y+=height;
@@ -689,14 +695,12 @@ fprintf(stderr,"waterfall_height=%d\n",height);
 #endif
 
   if(display_sliders) {
-fprintf(stderr,"sliders_height=%d\n",SLIDERS_HEIGHT);
     sliders = sliders_init(display_width,SLIDERS_HEIGHT,window);
     gtk_fixed_put(GTK_FIXED(fixed),sliders,0,y);
     y+=SLIDERS_HEIGHT;
   }
 
   if(display_toolbar) {
-fprintf(stderr,"toolbar_height=%d\n",TOOLBAR_HEIGHT);
     toolbar = toolbar_init(display_width,TOOLBAR_HEIGHT,window);
     gtk_fixed_put(GTK_FIXED(fixed),toolbar,0,y);
     y+=TOOLBAR_HEIGHT;
diff --git a/meter.c b/meter.c
index 23222d452bc03953b254ff1f242a1c294513c138..f95b790d250777dea2f2e9d10cb5d6ee687f7d93 100644 (file)
--- a/meter.c
+++ b/meter.c
@@ -317,7 +317,7 @@ void meter_update(int meter_type,double value,double reverse,double exciter,doub
 
       cairo_set_font_size(cr, 12);
       sprintf(sf,"%d dBm",(int)level);
-      cairo_move_to(cr, text_location, 45);
+      cairo_move_to(cr, text_location, meter_height-30);
       cairo_show_text(cr, sf);
 
 #ifdef FREEDV
index 8af62e58a3825c14821abda720d9ce8242680dbb..d09ad8d2122065200a3402db062f4ad7a74f1e0b 100644 (file)
@@ -47,6 +47,7 @@
 #include "noise_menu.h"
 #include "agc_menu.h"
 #include "fm_menu.h"
+#include "test_menu.h"
 
 
 static GtkWidget *parent_window=NULL;
@@ -238,6 +239,16 @@ static gboolean fm_cb (GtkWidget *widget, GdkEventButton *event, gpointer data)
   return TRUE;
 }
 
+void start_test() {
+  cleanup();
+  test_menu(parent_window);
+}
+
+static gboolean test_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+  start_test();
+  return TRUE;
+}
+
 static gboolean new_menu_pressed_event_cb (GtkWidget *widget,
                GdkEventButton *event,
                gpointer        data)
@@ -361,6 +372,11 @@ static gboolean new_menu_pressed_event_cb (GtkWidget *widget,
     g_signal_connect (agc_b, "button-press-event", G_CALLBACK(agc_cb), NULL);
     gtk_grid_attach(GTK_GRID(grid),agc_b,5,4,1,1);
 
+/*
+    GtkWidget *test_b=gtk_button_new_with_label("Test");
+    g_signal_connect (test_b, "button-press-event", G_CALLBACK(test_cb), NULL);
+    gtk_grid_attach(GTK_GRID(grid),test_b,0,5,1,1);
+*/
 
     gtk_container_add(GTK_CONTAINER(content),grid);
 
diff --git a/radio.c b/radio.c
index e957405d4dc7036fea408a432c167b5c108eaa44..3fc364765c41bd69e53c61f5d8a1d7040ed78f4a 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -340,25 +340,10 @@ void setFrequency(long long f) {
   BAND *band=band_get_current_band();
   BANDSTACK_ENTRY* entry=bandstack_entry_get_current();
 
-  if(entry->frequencyA!=f) {
-    switch(protocol) {
-      case NEW_PROTOCOL:
-      case ORIGINAL_PROTOCOL:
-        if(ctun) {
-          long long minf=entry->frequencyA-(long long)(sample_rate/2);
-          long long maxf=entry->frequencyA+(long long)(sample_rate/2);
-          if(f<minf) f=minf;
-          if(f>maxf) f=maxf;
-          ddsOffset=f-entry->frequencyA;
-          wdsp_set_offset(ddsOffset);
-          return;
-        } else {
-          entry->frequencyA=f;
-        }
-        break;
-#ifdef LIMESDR
-      case LIMESDR_PROTOCOL:
-        {
+  switch(protocol) {
+    case NEW_PROTOCOL:
+    case ORIGINAL_PROTOCOL:
+      if(ctun) {
         long long minf=entry->frequencyA-(long long)(sample_rate/2);
         long long maxf=entry->frequencyA+(long long)(sample_rate/2);
         if(f<minf) f=minf;
@@ -366,10 +351,23 @@ void setFrequency(long long f) {
         ddsOffset=f-entry->frequencyA;
         wdsp_set_offset(ddsOffset);
         return;
-        }
-        break;
+      } else {
+        entry->frequencyA=f;
+      }
+      break;
+#ifdef LIMESDR
+    case LIMESDR_PROTOCOL:
+      {
+      long long minf=entry->frequencyA-(long long)(sample_rate/2);
+      long long maxf=entry->frequencyA+(long long)(sample_rate/2);
+      if(f<minf) f=minf;
+      if(f>maxf) f=maxf;
+      ddsOffset=f-entry->frequencyA;
+      wdsp_set_offset(ddsOffset);
+      return;
+      }
+      break;
 #endif
-    }
   }
 
   displayFrequency=f;
index 23be96061249a4513abea7772edf130d87625ccb..c6eb5deecc68d7f14c29879a18a3aa81008894b0 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -1,4 +1,5 @@
-/* TS-2000 emulation via TCP
+
+/* S-2000 emulation via TCP
  * Copyright (C) 2016 Steve Wilson <wevets@gmail.com>
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
 #include "wdsp_init.h"
 #include "bandstack.h"
 #include "vfo.h"
+#include "sliders.h"
 #include <pthread.h>
 
 // IP stuff below
 #include<sys/socket.h>
 #include<arpa/inet.h> //inet_addr
 
-#define RIGCTL_DEBUG
+#undef RIGCTL_DEBUG
 
 // the port client will be connecting to
 #define PORT 19090  // This is the HAMLIB port
@@ -194,10 +196,6 @@ static void * rigctl (void * arg) {
                                             // Response - AG<0/1>123; Where 123 is 0-260
                                             if(len>4) { // Set Audio Gain
                                                volume = (double) atoi(&cmd_input[3])/260; 
-/*  KA6S - This crashes the system
-    BUG
-                                               set_af_gain(volume);               
-*/
                                                g_idle_add(update_af_gain,NULL);               
                                             } else { // Read Audio Gain
                                               sprintf(msg,"AG0%03d;",2.6 * volume);
@@ -327,9 +325,6 @@ static void * rigctl (void * arg) {
                                             if(len == 13) { //We are receiving freq info
                                                long long new_freqA = atoll(&cmd_input[2]);
                                                setFrequency(new_freqA);
-                                               // KA6S - this kills the system pretty quickly - it freezes
-                                               // vfo_update(NULL);
-                                               // BUG
                                                g_idle_add(vfo_update,NULL);
                                             } else {
                                                if(len==2) {
@@ -342,6 +337,7 @@ static void * rigctl (void * arg) {
                                             if(len==13) { //We are receiving freq info
                                                long long new_freqA = atoll(&cmd_input[2]); 
                                                setFrequency(new_freqA);
+                                               g_idle_add(vfo_update,NULL);
                                             } else if(len == 2) {
                                                sprintf(msg,"FB%011d;",getFrequency());
                                                send_resp(msg);
@@ -511,12 +507,20 @@ static void * rigctl (void * arg) {
                                             entry= (BANDSTACK_ENTRY *) 
                                                   bandstack_entry_get_current();
                                             entry->mode=new_mode;
+                                            //  BUG - kills the system when there is some
+                                            // GPIO activity and Mode sets occur. Used twittling the
+                                           // frequency along with setting mode between USB/LSB with
+                                           // flrig. Tried doing the g_idle_add trick - but don't know the
+                                           // the magic to get that to compile without warnings 
                                             setMode(entry->mode);
+                                            // Moved the vfo_update down after filter updated. (John G0ORX)
+                                            //g_idle_add(vfo_update,NULL);
                                             
                                             FILTER* band_filters=filters[entry->mode];
                                             FILTER* band_filter=&band_filters[entry->filter];
                                             setFilter(band_filter->low,band_filter->high);
                                             /* Need a way to update VFO info here..*/
+                                            g_idle_add(vfo_update,NULL);
                                             }  else {     // Read Mode
                                                int curr_mode;
                                                switch (mode) {
@@ -559,8 +563,11 @@ static void * rigctl (void * arg) {
                                                send_resp(msg);
                                             } else {
                                                int tval = atoi(&cmd_input[2]);                
-                                               new_vol = (double) tval/100; 
-                                               set_mic_gain(new_vol); 
+                                               new_vol = (double) tval/2; 
+                                               //set_mic_gain(new_vol); 
+                                               double *p_mic_gain=malloc(sizeof(double));
+                                               *p_mic_gain=new_vol;
+                                               g_idle_add(update_mic_gain,(void *)p_mic_gain);
                                             }
                                          }
         else if(strcmp(cmd_str,"ML")==0) {  // Set/read the monitor function level
@@ -669,9 +676,12 @@ static void * rigctl (void * arg) {
                                                //Scales to 0.00-1.00
                                                 
                                                double drive_val = 
-                                                   (double)(atoi(&cmd_input[2]))/10
+                                                   (double)(atoi(&cmd_input[2])); 
                                                // setDrive(drive_val);
-                                               set_drive(drive_val);
+                                               double *p_drive=malloc(sizeof(double));
+                                               *p_drive=drive_val;
+                                               g_idle_add(update_drive,(gpointer)p_drive);
+                                               //set_drive(drive_val);
                                             }
                                          }
         else if(strcmp(cmd_str,"PI")==0) {  // STore the programmable memory channel
@@ -736,8 +746,11 @@ static void * rigctl (void * arg) {
                                             // Scale from -20 - 120
                                             if(len>4) { // Set Audio Gain
                                                int base_value = atoi(&cmd_input[2]);
-                                               float new_gain = ((((float) base_value)/255) * 140) - 20; 
-                                               set_agc_gain(new_gain);               
+                                               double new_gain = ((((double) base_value)/255) * 140) - 20; 
+                                               //set_agc_gain(new_gain);               
+                                               double *p_gain=malloc(sizeof(double));
+                                               *p_gain=new_gain;
+                                               g_idle_add(update_agc_gain,(gpointer)p_gain);
                                             } else { // Read Audio Gain
                                               sprintf(msg,"RG%03d;",(255/140)*(agc_gain+20));
                                               send_resp(msg);
@@ -1014,7 +1027,7 @@ int init_server () {
     socket_desc = socket(AF_INET , SOCK_STREAM , 0);
     if (socket_desc == -1)
     {
-        fprintf(stderr,"RIGCTL: Could not create socket\n");
+        fprintf(stderr,"RIGCTL: Could not create socket");
     }
     fprintf(stderr, "RIGCTL: Socket created\n");
      
index 95f46aee8522ead76c32c85de20a79161b7ab48d..9361387ca17de8dc7fc0aec3c9c94e8f9ebd5631 100644 (file)
--- a/sliders.c
+++ b/sliders.c
@@ -20,6 +20,7 @@
 #include <gtk/gtk.h>
 #include <semaphore.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <math.h>
 
 #include "sliders.h"
@@ -156,6 +157,12 @@ void set_agc_gain(double value) {
   }
 }
 
+int update_agc_gain(void *data) {
+  set_agc_gain(*(double*)data);
+  free(data);
+  return 0;
+}
+
 static void afgain_value_changed_cb(GtkWidget *widget, gpointer data) {
     volume=gtk_range_get_value(GTK_RANGE(af_gain_scale))/100.0;
     SetRXAPanelGain1 (CHANNEL_RX0, volume);
@@ -240,6 +247,12 @@ void set_mic_gain(double value) {
   }
 }
 
+int update_mic_gain(void *data) {
+  set_mic_gain(*(double*)data);
+  free(data);
+  return 0;
+}
+
 void set_drive(double value) {
   setDrive(value);
   if(display_sliders) {
@@ -276,6 +289,12 @@ static void drive_value_changed_cb(GtkWidget *widget, gpointer data) {
   setDrive(gtk_range_get_value(GTK_RANGE(drive_scale)));
 }
 
+int update_drive(void *data) {
+  set_drive(*(double *)data);
+  free(data);
+  return 0;
+}
+
 void set_tune(double value) {
   setTuneDrive(value);
   if(display_sliders) {
index 2326c7f827e45ae30af2316ea4fa09ab8e93d5f7..8225e13837b9a64d31454fe276ddff05887d5401 100644 (file)
--- a/sliders.h
+++ b/sliders.h
 #ifndef _SLIDERS_H
 #define _SLIDERS_H
 
-int update_af_gain(void *data);
+extern int update_agc_gain(void *);
+extern int update_af_gain(void *);
+extern int update_mic_gain(void *);
+extern int update_drive(void *);
 
 void set_agc_gain(double value);
 void set_af_gain(double value);
diff --git a/test_menu.c b/test_menu.c
new file mode 100644 (file)
index 0000000..2b0191a
--- /dev/null
@@ -0,0 +1,82 @@
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*/
+
+#include <gtk/gtk.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "new_menu.h"
+
+static GtkWidget *parent_window=NULL;
+
+static GtkWidget *dialog=NULL;
+
+static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+  if(dialog!=NULL) {
+    gtk_widget_destroy(dialog);
+    dialog=NULL;
+    sub_menu=NULL;
+  }
+  return TRUE;
+}
+
+static gboolean test_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) {
+  gtk_window_iconify(GTK_WINDOW(parent_window));
+  return TRUE;
+}
+
+void test_menu(GtkWidget *parent) {
+
+  parent_window=parent;
+
+  dialog=gtk_dialog_new();
+  gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(parent_window));
+  gtk_window_set_decorated(GTK_WINDOW(dialog),FALSE);
+
+  GdkRGBA color;
+  color.red = 1.0;
+  color.green = 1.0;
+  color.blue = 1.0;
+  color.alpha = 1.0;
+  gtk_widget_override_background_color(dialog,GTK_STATE_FLAG_NORMAL,&color);
+
+  GtkWidget *content=gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+
+  GtkWidget *grid=gtk_grid_new();
+
+  gtk_grid_set_column_homogeneous(GTK_GRID(grid),TRUE);
+  gtk_grid_set_row_homogeneous(GTK_GRID(grid),TRUE);
+  gtk_grid_set_column_spacing (GTK_GRID(grid),5);
+  gtk_grid_set_row_spacing (GTK_GRID(grid),5);
+
+  GtkWidget *close_b=gtk_button_new_with_label("Close Test");
+  g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
+  gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);
+
+  GtkWidget *test_b=gtk_button_new_with_label("Test");
+  g_signal_connect (test_b, "pressed", G_CALLBACK(test_cb), NULL);
+  gtk_grid_attach(GTK_GRID(grid),test_b,0,1,1,1);
+
+  gtk_container_add(GTK_CONTAINER(content),grid);
+
+  sub_menu=dialog;
+
+  gtk_widget_show_all(dialog);
+
+}
diff --git a/test_menu.h b/test_menu.h
new file mode 100644 (file)
index 0000000..1a24455
--- /dev/null
@@ -0,0 +1,20 @@
+/* Copyright (C)
+* 2016 - John Melton, G0ORX/N6LYT
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+*
+*/
+
+void test_menu(GtkWidget *parent);
index 18d8fd20b124f1d9253e19a539936bd1bc1d4851..6760a44f1c3e84642fcf4b93b3089405f2a3e731 100644 (file)
@@ -139,6 +139,7 @@ int getMode() {
 }
 
 void setFilter(int low,int high) {
+
     if(mode==modeCWL) {
         filterLow=-cw_keyer_sidetone_frequency-low;
         filterHigh=-cw_keyer_sidetone_frequency+high;
@@ -150,15 +151,12 @@ void setFilter(int low,int high) {
         filterHigh=high;
     }
 
+    RXASetPassband(receiver,(double)filterLow,(double)filterHigh);
+
     double fl=filterLow+ddsOffset;
     double fh=filterHigh+ddsOffset;
-
-    //RXANBPSetFreqs(receiver,(double)filterLow,(double)filterHigh);
-    //SetRXABandpassFreqs(receiver, fl,fh);
-    //SetRXASNBAOutputBandwidth(receiver, (double)filterLow, (double)filterHigh);
-    RXASetPassband(receiver,fl,fh);
-
     SetTXABandpassFreqs(CHANNEL_TX, fl,fh);
+
 }
 
 int getFilterLow() {
@@ -215,16 +213,6 @@ void wdsp_set_offset(long long offset) {
     RXANBPSetShiftFrequency(receiver, (double)offset);
     SetRXAShiftRun(receiver, 1);
   }
-
-/*
-  BAND *band=band_get_current_band();
-  BANDSTACK_ENTRY* entry=bandstack_entry_get_current();
-  setFrequency(entry->frequencyA);
-  setMode(entry->mode);
-  FILTER* band_filters=filters[entry->mode];
-  FILTER* band_filter=&band_filters[entry->filter];
-  setFilter(band_filter->low,band_filter->high);
-*/
 }
 
 void wdsp_set_input_rate(double rate) {