]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Maintain atlas_janus for "Janus Only" operation
authorc vw <dl1ycf@darc.de>
Fri, 14 Jan 2022 15:14:02 +0000 (16:14 +0100)
committerc vw <dl1ycf@darc.de>
Fri, 14 Jan 2022 15:14:02 +0000 (16:14 +0100)
old_protocol.c
radio.c
radio_menu.c

index 09dd609eb29c356a72ca4e27297b75677b656d7f..1fcb9cae671e2ef326319b04ce0d66524589419a 100644 (file)
@@ -1413,19 +1413,13 @@ void ozy_send_buffer() {
 #ifdef USBOZY
     if (device == DEVICE_OZY && atlas_janus) {
       //
-      // The JANUS is not a radio but a sound card.
-      // pihpsdr should do RX and TX but all the frequency,
-      // RX frontend, TX filters, etc. settings are
-      // not respected (and not sent).
+      // Why is this shortcut needed?
       //
       output_buffer[C2]=0x00;
       output_buffer[C3]=0x00;
       output_buffer[C4]=0x00;
       ozyusb_write(output_buffer,OZY_BUFFER_SIZE);
-      //
-      // Take care we also send a C0=0 packet next time
-      //
-      metis_offset=8;
+      metis_offset=8;  // take care next packet is a C0=0 packet
       return;
     }
 #endif
diff --git a/radio.c b/radio.c
index 5c91716d58b1a9e65bd38114a320d1970a62aa38..6b202a54bdc985e981174325dc2a73b1ffe2a2bd 100644 (file)
--- a/radio.c
+++ b/radio.c
@@ -2081,6 +2081,8 @@ g_print("radioRestoreState: %s\n",property_path);
     if(value) atlas_clock_source_128mhz=atoi(value);
     value=getProperty("atlas_mic_source");
     if(value) atlas_mic_source=atoi(value);
+    value=getProperty("atlas_janus");
+    if(value) atlas_janus=atoi(value);
     value=getProperty("tx_out_of_band");
     if(value) tx_out_of_band=atoi(value);
     value=getProperty("filter_board");
@@ -2447,6 +2449,8 @@ g_print("radioSaveState: %s\n",property_path);
     setProperty("atlas_clock_source_128mhz",value);
     sprintf(value,"%d",atlas_mic_source);
     setProperty("atlas_mic_source",value);
+    sprintf(value,"%d",atlas_janus);
+    setProperty("atlas_janus",value);
     sprintf(value,"%d",filter_board);
     setProperty("filter_board",value);
     sprintf(value,"%d",tx_out_of_band);
index 12ef5dfcf1f06a98acb2913bd6674ccdcc059f3d..070f4ca4a2d8c6f6c50484b3d38ec2e34d69a81a 100644 (file)
@@ -423,6 +423,10 @@ static void tx_cb(GtkWidget *widget, gpointer data) {
   atlas_penelope=gtk_combo_box_get_active (GTK_COMBO_BOX(widget));
 }
 
+static void janus_cb(GtkWidget *widget, gpointer data) {
+  atlas_janus=atlas_janus==1?0:1;
+}
+
 void radio_menu(GtkWidget *parent) {
   parent_window=parent;
 
@@ -755,6 +759,22 @@ void radio_menu(GtkWidget *parent) {
 
     row++;
 
+#ifdef USBOZY
+    //
+    // This option is for ATLAS systems which *only* have an OZY
+    // and a JANUS board (the RF front end then is either SDR-1000 or SoftRock)
+    //
+    // It is assumed that the SDR-1000 is controlled outside piHPSDR
+    //
+    if (protocol == ORIGINAL_PROTOCOL && device == DEVICE_OZY) {
+      GtkWidget *janus_b=gtk_check_button_new_with_label("Janus Only");
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (janus_b), atlas_janus);
+      gtk_grid_attach(GTK_GRID(grid),janus_b,col+1,row,1,1);
+      g_signal_connect(janus_b,"toggled",G_CALLBACK(janus_cb),NULL);
+      row++;
+    }
+#endif
+
     if(row>temp_row) temp_row=row;
   }