From 01fc446e66a237b8100fbf17415fc1ac3ae1df7d Mon Sep 17 00:00:00 2001 From: c vw <dl1ycf@darc.de> Date: Fri, 10 Jul 2020 14:28:27 +0200 Subject: [PATCH] Manually merged from John: support for the switchable preamp of first-generation HPSDR boards --- old_protocol.c | 14 ++++++++++---- rx_menu.c | 11 +++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/old_protocol.c b/old_protocol.c index b13bc47..14dabfc 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -1422,10 +1422,16 @@ static int last_power=0; case 4: output_buffer[C0]=0x14; output_buffer[C1]=0x00; - // All current boards have NO switchable preamps - //for(i=0;i<receivers;i++) { - // output_buffer[C1]|=(receiver[i]->preamp<<i); - //} + +#ifdef USBOZY + if ((device == DEVICE_OZY) || (device == DEVICE_METIS)) { +#else + if (device == DEVICE_METIS) { +#endif + for(i=0;i<receivers;i++) { + output_buffer[C1]|=(receiver[i]->preamp<<i); + } + } if(mic_ptt_enabled==0) { output_buffer[C1]|=0x40; } diff --git a/rx_menu.c b/rx_menu.c index 4390f37..c56a5e4 100644 --- a/rx_menu.c +++ b/rx_menu.c @@ -310,6 +310,17 @@ void rx_menu(GtkWidget *parent) { gtk_grid_attach(GTK_GRID(grid),random_b,x,3,1,1); g_signal_connect(random_b,"toggled",G_CALLBACK(random_cb),NULL); + if((protocol==ORIGINAL_PROTOCOL && device == DEVICE_METIS) || +#ifdef USBOZY + (protocol==ORIGINAL_PROTOCOL && device == DEVICE_OZY) || +#endif + (protocol==NEW_PROTOCOL && device == NEW_DEVICE_ATLAS)) { + GtkWidget *preamp_b=gtk_check_button_new_with_label("Preamp"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (preamp_b), active_receiver->preamp); + gtk_grid_attach(GTK_GRID(grid),preamp_b,x,4,1,1); + g_signal_connect(preamp_b,"toggled",G_CALLBACK(preamp_cb),NULL); + } + if (filter_board == ALEX && active_receiver->adc == 0 && ((protocol==ORIGINAL_PROTOCOL && device != DEVICE_ORION2) || (protocol==NEW_PROTOCOL && device != NEW_DEVICE_ORION2))) { -- 2.45.2