diff options
author | root <root@fedora-arm.domain.avtechpulse.com> | 1999-12-31 19:50:00 -0500 |
---|---|---|
committer | root <root@fedora-arm.domain.avtechpulse.com> | 1999-12-31 19:50:00 -0500 |
commit | 80b991816acb29e645fa7e047325942f8f050861 (patch) | |
tree | d44958d923a3578eaa13bb4432648889b08909a4 /device-functions.c | |
parent | 3702b14f594c86af91e063e8b1403e7bfd982bfe (diff) |
add new files
Diffstat (limited to 'device-functions.c')
-rw-r--r-- | device-functions.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/device-functions.c b/device-functions.c new file mode 100644 index 0000000..9422b40 --- /dev/null +++ b/device-functions.c @@ -0,0 +1,39 @@ +#include "device-functions.h"
+
+/* START FUNCTION DESCRIPTION ********************************************
+Set_frequency <DEVFUNC.LIB>
+
+SYNTAX: Set_frequency(int check_possible_only,int word_override,int range_override,int channel,float set_freq)
+
+KEYWORDS:
+
+DESCRIPTION: sets the offset DAC.
+
+RETURN VALUE: error code (zero = OK).
+END DESCRIPTION **********************************************************/
+
+/*----------------------------------------------------------------------------------------------------------*/
+int Set_frequency(int check_possible_only,int word_override,int range_override,int channel,float set_freq)
+{
+ // keep, but ignore, the first 3 parameters for now
+
+ // all this does right now is check the frequency range,
+ // and store the set value.
+
+ /* abandon if high channel selected by user but not enabled by firmware */
+ if (channel && !globals.Flash.ChanKey_frequency) {
+ return InvalidChannel;
+ }
+
+ if (set_freq < 1.0) {
+ return freq_lower_limit;
+ }
+ if (set_freq > 1.0e6) {
+ return freq_upper_limit;
+ }
+
+ globals.ChannelState[channel].frequency=set_freq;
+
+ return OK;
+}
+
|