diff options
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/device-functions.c b/device-functions.c index 081d63c..1ad00ba 100644 --- a/device-functions.c +++ b/device-functions.c @@ -1,6 +1,8 @@ #include "device-functions.h" #include "globals.h" #include "version.h" +#include "error_utils.h" +#include <glib.h> /*** BeginHeader idn_string */ @@ -24,17 +26,23 @@ int Set_frequency(int check_possible_only,int word_override,int range_override,i // all this does right now is check the frequency range, // and store the set value. + int check_valid; + /* abandon if high channel selected by user but not enabled by firmware */ if (channel && !globals.Flash.ChanKey_frequency) { return InvalidChannel; } - if (set_freq < globals.Flash.min_freq[channel]) { - return freq_lower_limit; - } - if (set_freq > globals.Flash.max_freq[channel]) { - return freq_upper_limit; - } + if (!check_possible_only) { + int i; + for (i=0; i<max_channels; ++i) { + TestState[i]=globals.ChannelState[i]; + } + TestState[channel].frequency=set_freq; + if ((check_valid=Error_check(TestState))) { + return check_valid; + } + } globals.ChannelState[channel].frequency=set_freq; |