From cdd1a61d1754eb3c342911677dde67f1261e6fe9 Mon Sep 17 00:00:00 2001 From: c vw Date: Tue, 3 Nov 2020 14:24:32 +0100 Subject: [PATCH] Add HL2 "PA enable" checkbox in radio menu --- old_protocol.c | 4 ++-- radio_menu.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/old_protocol.c b/old_protocol.c index 2c3a2d1..6046fa1 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -1704,13 +1704,13 @@ static int last_power=0; output_buffer[C2]|=0x02; } if(filter_board==APOLLO || device==DEVICE_HERMES_LITE2) { - output_buffer[C2]|=0x2C; + output_buffer[C2]|=0x24; } if((filter_board==APOLLO) && tune) { output_buffer[C2]|=0x10; } if((device==DEVICE_HERMES_LITE2) && pa_enabled) { - output_buffer[C2]|=0x10; // Enable PA + output_buffer[C2]|=0x08; // Enable PA } if(band_get_current()==band6) { output_buffer[C3]=output_buffer[C3]|0x40; // Alex 6M low noise amplifier diff --git a/radio_menu.c b/radio_menu.c index 9400f2b..25dafdf 100644 --- a/radio_menu.c +++ b/radio_menu.c @@ -236,6 +236,10 @@ void setDuplex() { g_idle_add(ext_vfo_update, NULL); } +static void PA_enable_cb(GtkWidget *widget, gpointer data) { + pa_enabled=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); +} + static void duplex_cb(GtkWidget *widget, gpointer data) { if (isTransmitting()) { gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (duplex_b), duplex); @@ -801,6 +805,15 @@ void radio_menu(GtkWidget *parent) { gtk_spin_button_set_value(GTK_SPIN_BUTTON(rx_gain_calibration_b),(double)rx_gain_calibration); gtk_grid_attach(GTK_GRID(grid),rx_gain_calibration_b,col,row,1,1); g_signal_connect(rx_gain_calibration_b,"value_changed",G_CALLBACK(rx_gain_calibration_value_changed_cb),NULL); + col++; + + if ((protocol == ORIGINAL_PROTOCOL && device == DEVICE_HERMES_LITE2) || + (protocol == NEW_PROTOCOL && device == NEW_DEVICE_HERMES_LITE2)) { + GtkWidget *PA_enable_b=gtk_check_button_new_with_label("HL2 PA enable"); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (PA_enable_b), pa_enabled); + gtk_grid_attach(GTK_GRID(grid),PA_enable_b,col,row,1,1); + g_signal_connect(PA_enable_b,"toggled",G_CALLBACK(PA_enable_cb),NULL); + } row++; } -- 2.45.2