summaryrefslogtreecommitdiff
path: root/device-functions.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-23 14:49:16 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-23 14:49:16 -0400
commit8ca8f7fbf06ac9ce5f2817e31d6bae330f243aa1 (patch)
treec4c5f0f70234d8dc3a6e3fc4995af0053e144035 /device-functions.c
parent913fc3cf402788ec671102f76ad27dc9436be6f6 (diff)
added full error checker
Diffstat (limited to 'device-functions.c')
-rw-r--r--device-functions.c20
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;