From 9e9142ac7dbeffa4509ecbdf89a8210a7ef3e368 Mon Sep 17 00:00:00 2001 From: c vw Date: Mon, 6 Dec 2021 15:15:05 +0100 Subject: [PATCH] mox_update/tune_update: if (!can_transmit), then quickly return --- toolbar.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/toolbar.c b/toolbar.c index 3ea2693..916539c 100644 --- a/toolbar.c +++ b/toolbar.c @@ -84,24 +84,6 @@ static gint xit_minus_timer=-1; SWITCH *toolbar_switches=switches_controller1[0]; -static gboolean rit_timer_cb(gpointer data) { - int i=GPOINTER_TO_INT(data); - vfo_rit(active_receiver->id,i); - return TRUE; -} - -static gboolean xit_timer_cb(gpointer data) { - int i=GPOINTER_TO_INT(data); - transmitter->xit+=(i*rit_increment); - if(transmitter->xit>10000) transmitter->xit=10000; - if(transmitter->xit<-10000) transmitter->xit=-10000; - if(protocol==NEW_PROTOCOL) { - schedule_high_priority(); - } - g_idle_add(ext_vfo_update,NULL); - return TRUE; -} - void update_toolbar_labels() { gtk_button_set_label(GTK_BUTTON(sim_mox),ActionTable[toolbar_switches[0].switch_function].button_str); gtk_button_set_label(GTK_BUTTON(sim_s1),ActionTable[toolbar_switches[1].switch_function].button_str); @@ -113,8 +95,14 @@ void update_toolbar_labels() { gtk_button_set_label(GTK_BUTTON(sim_function),ActionTable[toolbar_switches[7].switch_function].button_str); } +// +// move mox_update and tune_update to actions.c on the long run +// Note they are also called from RigCtl +// + void mox_update(int state) { //fprintf(stderr,"mox_update: state=%d\n",state); + if (!can_transmit) return; if(getTune()==1) { setTune(0); } @@ -131,6 +119,7 @@ void mox_update(int state) { } void tune_update(int state) { + if (!can_transmit) return; if(getMox()==1) { setMox(0); } -- 2.45.2