mrfioc2  2.3.0
Macros | Functions
FracSynthAnalyze.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <epicsTypes.h>
#include <mrfCommon.h>
#include <debugPrint.h>
#include <epicsExport.h>
#include <mrfFracSynth.h>
#include <mrfFracSynth.c>
Include dependency graph for FracSynthAnalyze.c:

Go to the source code of this file.

Macros

#define HOST_BUILD
 

Functions

int main (int argc, char *argv[])
 

Macro Definition Documentation

◆ HOST_BUILD

#define HOST_BUILD

Definition at line 94 of file FracSynthAnalyze.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 104 of file FracSynthAnalyze.c.

104  {
105 
106  /*---------------------
107  * Local Variables
108  */
109  int badArgs = 1; /* True if we could not parse the argument list */
110  epicsUInt32 controlWord; /* SY87739L control word to analyze */
111  char *tailPtr; /* Pointer to tail of parsed control word string */
112 
113  /*---------------------
114  * Make sure we were passed only one argument.
115  * If so, see if we can parse it as a hexadecimal number.
116  */
117  if (argc == 2) {
118  controlWord = strtoul (argv[1], &tailPtr, 16);
119 
120  /*---------------------
121  * If we successfully parsed the control word,
122  * analyze it and display the results.
123  */
124  if ((errno == OK) && (tailPtr != argv[1])) {
126  badArgs = 0;
127  }/*end if control word parse was successful*/
128 
129  }/*end if we had the right number of arguments*/
130 
131  /*---------------------
132  * Print the "Usage" message if we could not parse the argument.
133  */
134  if (badArgs) {
135  printf ("Usage:\n");
136  printf ("FracSynthAnalyze <ControlWord>\n");
137  printf (" Where <ControlWord> is a hexadecimal number representing\n");
138  printf (" a Micrel SY87739L control word to be analyzed.\n");
139  }/*end if could not parse arguments*/
140 
141  /*---------------------
142  * Always return success.
143  */
144  return OK;
145 
146 }/*end main()*/
#define OK
Definition: mrfFracSynth.h:81
#define MRF_FRAC_SYNTH_REF
Definition: mrfCommon.h:99
epicsShareExtern epicsFloat64 FracSynthAnalyze(epicsUInt32 ControlWord, epicsFloat64 ReferenceFreq, epicsInt32 PrintFlag)
Definition: mrfFracSynth.c:844
#define DP_DEBUG
Definition: debugPrint.h:93