A:公用.h。[只包括一些公共定义],如,define uchar unsigned char.之类,
// 公共 头文件。切忌,中间不能有任何变量定义,否则编译通不
// 过
file1.c [模块一]
{
变量端口定义
内部函数声明
系统 include"子模块.h" //注意他应该放在前两者后面
函数1();
函数2();
...........
}
file1.h [模块一对外申明] //其他file*.c如果需要,只需要包含它即可
{
#ifndef __file1_h__
#define __file1_h__
extern char/bit aa; //必须是file1.c中的全局auto变量
// 此 处不能有赋值行为
extern void/char 函数1(); //外部C文件需要用的函数,so对外声明
#endif
}
子模块.h [内部比较成型的函数]
{
#ifndef ...
#define ...
这比较简单
#endif
}