From 7810c7cab295fa5be238974cd169a4353a97fcf8 Mon Sep 17 00:00:00 2001 From: c vw Date: Fri, 14 Jan 2022 16:14:02 +0100 Subject: [PATCH] Maintain atlas_janus for "Janus Only" operation --- old_protocol.c | 10 ++-------- radio.c | 4 ++++ radio_menu.c | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/old_protocol.c b/old_protocol.c index 09dd609..1fcb9ca 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -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 5c91716..6b202a5 100644 --- 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); diff --git a/radio_menu.c b/radio_menu.c index 12ef5df..070f4ca 100644 --- a/radio_menu.c +++ b/radio_menu.c @@ -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; } -- 2.45.2