Locating header files for source code used in DEMO9S08QG8

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Locating header files for source code used in DEMO9S08QG8

3,596 次查看
tjm
Contributor I
I need to know where I can find the following header files for these include statements:

#include "adc.h"
#include "buzzer.h"
#include "SCItx.h"

I'm using sample source code provided in application note AN3397.pdf, "Implementing Positioning Algorithms Using Accelerometers"

Those 3 headers are not amongst all the code samples in the various CW folders.

Thanks,

~Tim



标签 (1)
0 项奖励
4 回复数

526 次查看
M4v3r1ck
Contributor I
Does anyone know where I can locate these files?  Im working with the accerelometers and I need to know what functions are in theses headers.
0 项奖励

526 次查看
bigmac
Specialist III
Hello,
 
I don't know specifically where you will find these files.  However, I would expect that these header files would contain function definitions (prototypes), and perhaps some macros definitions for the various peripheral items ADC, buzzer and SCI transmit operation.  There should be no code within the header files.  It may well be possible to re-construct the contents of these files.  It may also be possible that some of the definitions are never used within the final code.
 
If you have .c files of similar names, you can immediately determine the function definitions from the code for each function.  If the functions are within a library file for which you do not have the source code, you might need to do some experimentation by examining the way in which each function is called.  The compiler should provide warnings for those functions where a function definition cannot be not found, or does not match the code for the function.
 
The compiler should also provide warnings where a macro definition is missing.  These might pose a greater difficulty for re-construction, if complex.  But first you will need to ascertain the extent of the problem by examination of compiler warnings and errors.
 
Regards,
Mac
 
0 项奖励

526 次查看
M4v3r1ck
Contributor I
After posting last night,I threw the code in to the compiler to see which variables and functions where giving me warnings.  I am missing a function called ADC_GetAllAxis(); which would not be hard to rewrite, an END_OF_FRAME variable, some accelerationx[] and y[] arrays, and a SCITxMsg() function.  I am assuming my best best would be to rewrite everything from the giving flowchart and use the code as a guide if I get stuck.  I just find it surprising that they would provide source code without providing a means to the other necessary files for the code.Thanks for you help Mac.
0 项奖励

526 次查看
bigmac
Specialist III
Hello,
 
It sounds like more than just the header files are missing if the function code cannot be found by the linker.  The header file should not contain any code, but only the declaration or prototype for its associated functions.  I might expect there should exist separate .c files, with names similar to the header files.
 
For example, I suspect there should be a file ADC.c that would contain the code for tha function ADC_GetAllAxis().  It may also contain code for other (private) functions called by this function.  It is possible that the x[ ] and y[ ] arrays are global variables defined in the same file.  The header file ADC.h would contain the prototype for the ADC_GetAllAxis() function, and declarations for the global arrays.
 
END_OF_FRAME is likely to be a macro definition (rather than a variable).  Perhaps it is associated with use of the SCI function(s).
 
Regards,
Mac
 
0 项奖励