From 6f786afb05877a53deff747a7bf451811d2218e4 Mon Sep 17 00:00:00 2001 From: John Melton G0ORX Date: Tue, 3 Mar 2020 12:45:53 +0000 Subject: [PATCH] changed encoder actions for diversity gain and phase --- ext.c | 27 +++++++++++++++++++++++++++ ext.h | 19 +++++++++++++++++++ gpio.c | 20 ++++++-------------- gpio.h | 6 ++---- 4 files changed, 54 insertions(+), 18 deletions(-) diff --git a/ext.c b/ext.c index 34981e0..4c4f522 100644 --- a/ext.c +++ b/ext.c @@ -42,6 +42,7 @@ #include "bandstack.h" #include "noise_menu.h" #include "wdsp.h" +#include "ext.h" // The following calls functions can be called usig g_idle_add @@ -643,3 +644,29 @@ int ext_set_duplex(void *data) { setDuplex(); return 0; } + +int ext_set_rx_frequency(void *data) { + RX_FREQUENCY *p=(RX_FREQUENCY *)data; + int b = get_band_from_frequency(p->frequency); + if (b != vfo[p->rx].band) { + vfo_band_changed(b); + } + setFrequency(p->frequency); + g_free(data); + return 0; + + return 0; +} + +int ext_set_rx_mode(void *data) { + RX_MODE *p=(RX_MODE *)data; + vfo_mode_changed(p->mode); + return 0; +} + +int ext_set_rx_filter(void *data) { + RX_FILTER *p=(RX_FILTER *)data; + vfo_filter_changed(p->filter); + return 0; +} + diff --git a/ext.h b/ext.h index 810be49..8860e4c 100644 --- a/ext.h +++ b/ext.h @@ -23,6 +23,21 @@ // Use these calls from within the rigclt daemon, or the GPIO or MIDI stuff // +typedef struct _RX_FREQUENCY { + int rx; + long long frequency; +} RX_FREQUENCY; + +typedef struct _RX_MODE { + int rx; + int mode; +} RX_MODE; + +typedef struct _RX_FILTER { + int rx; + int filter; +} RX_FILTER; + extern int ext_discovery(void *data); extern int ext_vfo_update(void *data); extern int ext_set_frequency(void *data); @@ -114,3 +129,7 @@ int ext_update_noise(void *data); #ifdef PURESIGNAL int ext_start_ps(void *data); #endif + +int ext_set_rx_frequency(void *data); +int ext_set_rx_mode(void *data); +int ext_set_rx_filter(void *data); diff --git a/gpio.c b/gpio.c index be0389f..4da17aa 100644 --- a/gpio.c +++ b/gpio.c @@ -223,10 +223,8 @@ char *encoder_string[ENCODER_ACTIONS] = { "SQUELCH RX1", "SQUELCH RX2", "COMP", - "DIVERSITY GAIN COARSE", - "DIVERSITY GAIN FINE", - "DIVERSITY PHASE COARSE", - "DIVERSITY PHASE FINE"}; + "DIVERSITY GAIN", + "DIVERSITY PHASE"}; char *sw_string[SWITCH_ACTIONS] = { "", @@ -2054,17 +2052,11 @@ static void encoder_changed(int action,int pos) { transmitter->compressor_level=(int)value; set_compression(transmitter); break; - case ENCODER_DIVERSITY_GAIN_COARSE: - update_diversity_gain_coarse((double)pos); + case ENCODER_DIVERSITY_GAIN: + update_diversity_gain((double)pos); break; - case ENCODER_DIVERSITY_GAIN_FINE: - update_diversity_gain_fine((double)pos); - break; - case ENCODER_DIVERSITY_PHASE_COARSE: - update_diversity_phase_coarse((double)pos); - break; - case ENCODER_DIVERSITY_PHASE_FINE: - update_diversity_phase_fine((double)pos); + case ENCODER_DIVERSITY_PHASE: + update_diversity_phase((double)pos); break; } } diff --git a/gpio.h b/gpio.h index 536d9e0..f90f188 100644 --- a/gpio.h +++ b/gpio.h @@ -66,10 +66,8 @@ enum { ENCODER_SQUELCH_RX1, ENCODER_SQUELCH_RX2, ENCODER_COMP, - ENCODER_DIVERSITY_GAIN_COARSE, - ENCODER_DIVERSITY_GAIN_FINE, - ENCODER_DIVERSITY_PHASE_COARSE, - ENCODER_DIVERSITY_PHASE_FINE, + ENCODER_DIVERSITY_GAIN, + ENCODER_DIVERSITY_PHASE, ENCODER_ACTIONS }; -- 2.45.2