]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
More code cleanup
authorYour Name <john.d.melton@googlemail.com>
Tue, 8 Dec 2020 14:40:17 +0000 (14:40 +0000)
committerYour Name <john.d.melton@googlemail.com>
Tue, 8 Dec 2020 14:40:17 +0000 (14:40 +0000)
display_menu.c
i2c_controller.c
radio.c
zoompan.c

index 7dbf1e3b5d0b681fa4c5315e1f52b74b067cdc04..0dba23bf2cbb90e38684c0db392c48ff84c83433 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "main.h"
 #include "new_menu.h"
 #include "display_menu.h"
 #include "channel.h"
@@ -439,23 +440,25 @@ void display_menu(GtkWidget *parent) {
 
   col++;
 
-  GtkWidget *b_display_sliders=gtk_check_button_new_with_label("Display Sliders");
-  //gtk_widget_override_font(b_display_sliders, pango_font_description_from_string("Arial 18"));
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_display_sliders), display_sliders);
-  gtk_widget_show(b_display_sliders);
-  gtk_grid_attach(GTK_GRID(grid),b_display_sliders,col,row,1,1);
-  g_signal_connect(b_display_sliders,"toggled",G_CALLBACK(display_sliders_cb),(gpointer *)NULL);
-
-  col++;
-
-  GtkWidget *b_display_toolbar=gtk_check_button_new_with_label("Display Toolbar");
-  //gtk_widget_override_font(b_display_toolbar, pango_font_description_from_string("Arial 18"));
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_display_toolbar), display_toolbar);
-  gtk_widget_show(b_display_toolbar);
-  gtk_grid_attach(GTK_GRID(grid),b_display_toolbar,col,row,1,1);
-  g_signal_connect(b_display_toolbar,"toggled",G_CALLBACK(display_toolbar_cb),(gpointer *)NULL);
-
-  col++;
+  if(controller!=CONTROLLER_I2C) {
+    GtkWidget *b_display_sliders=gtk_check_button_new_with_label("Display Sliders");
+    //gtk_widget_override_font(b_display_sliders, pango_font_description_from_string("Arial 18"));
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_display_sliders), display_sliders);
+    gtk_widget_show(b_display_sliders);
+    gtk_grid_attach(GTK_GRID(grid),b_display_sliders,col,row,1,1);
+    g_signal_connect(b_display_sliders,"toggled",G_CALLBACK(display_sliders_cb),(gpointer *)NULL);
+  
+    col++;
+  
+    GtkWidget *b_display_toolbar=gtk_check_button_new_with_label("Display Toolbar");
+    //gtk_widget_override_font(b_display_toolbar, pango_font_description_from_string("Arial 18"));
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_display_toolbar), display_toolbar);
+    gtk_widget_show(b_display_toolbar);
+    gtk_grid_attach(GTK_GRID(grid),b_display_toolbar,col,row,1,1);
+    g_signal_connect(b_display_toolbar,"toggled",G_CALLBACK(display_toolbar_cb),(gpointer *)NULL);
+  
+    col++;
+  }
 
   GtkWidget *b_display_sequence_errors=gtk_check_button_new_with_label("Display Seq Errs");
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_display_sequence_errors), display_sequence_errors);
index e5d76663992f43a51f71e90d544878c1dca1b189..9827f78e290849da1a149e23501c01f2dce621b3 100644 (file)
@@ -252,8 +252,7 @@ static void i2c_interrupt(int line) {
         }
         
         __s32 status=i2c_smbus_read_byte_data(fd,REG_ESTATUS);
-        g_print("%s: address=%02X status=%02X\n",__FUNCTION__,encoder[i].address,status&0xFF);
-
+        //g_print("%s: address=%02X status=%02X\n",__FUNCTION__,encoder[i].address,status&0xFF);
 
         if(status&PUSHR) {
           //g_print("%s: PUSHR\n",__FUNCTION__);
diff --git a/radio.c b/radio.c
index 290481c8a09bed148f1dbb81e35854ec9c378fa7..ed6d2cf8b8bc24966f0c5bf351b42701e5c12337 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -169,7 +169,7 @@ int panadapter_high=-40;
 int panadapter_low=-140;
 
 int display_filled=1;
-int display_gradient=0;
+int display_gradient=1;
 int display_detector_mode=DETECTOR_MODE_AVERAGE;
 int display_average_mode=AVERAGE_MODE_LOG_RECURSIVE;
 double display_average_time=120.0;
@@ -1152,16 +1152,21 @@ void start_radio() {
 
 #ifdef GPIO
   switch(controller) {
+    case NO_CONTROLLER:
+      display_zoompan=1;
+      display_sliders=1;
+      display_toolbar=1;
+      break;
     case CONTROLLER2_V1:
     case CONTROLLER2_V2:
       display_zoompan=1;
       display_sliders=0;
       display_toolbar=0;
       break;
-    default:
-      display_zoompan=1;
-      display_sliders=1;
-      display_toolbar=1;
+    case CONTROLLER_I2C:
+      display_zoompan=0;
+      display_sliders=0;
+      display_toolbar=0;
       break;
   }
 #else
index bcf86c9079fec788dfc141c56035aeb1fd8f07ae..91bda575a4df2fbc1a9f51460891036514246f5d 100644 (file)
--- a/zoompan.c
+++ b/zoompan.c
@@ -96,7 +96,7 @@ g_print("zoom_value_changed_cb\n");
 }
 
 void set_zoom(int rx,double value) {
-g_print("set_zoom: %f\n",value);
+//g_print("set_zoom: %f\n",value);
   receiver[rx]->zoom=value;
   if(display_zoompan) {
     gtk_range_set_value (GTK_RANGE(zoom_scale),receiver[rx]->zoom);
@@ -145,7 +145,7 @@ g_print("remote_set_zoom: EXIT\n");
 }
 
 void update_zoom(double zoom) {
-g_print("update_zoom: %f\n",zoom);
+//g_print("update_zoom: %f\n",zoom);
   int z=active_receiver->zoom+(int)zoom;
   if(z>MAX_ZOOM) z=MAX_ZOOM;
   if(z<1) z=1;