我的 libc prj 在编译时不会发出四个函数调用的错误标志。 这四个调用每个调用引用一个结构参数。 我在源代码中提供了第一个具有代表性的函数。 每个具有结构的函数都会给出错误和相应的警告...当所有这些都在一个头文件中时,所有这些都可以正常工作。 有人能告诉我、我需要做些什么来允许在公共标头中提供包含结构的函数声明、同时在私有中隐藏不需要的结构? 我发现可以提供文档、向用户显示结构参数。
错误:
#148声明与"char radioBusyPinConfig (struct busyPin *)"不兼容(在"D:\customers\Firmware\LPRS_lib\Header\lprs_public.h"的第43行声明)
#148声明与"uint * config_timer (struct confTimer *)"不兼容(在"D:\customers\Firmware\LPRS_lib\Header\lprs_public.h"的第40行声明)
#148声明与"uint * run_timer (struct confTimer *、const char *)"不兼容(在"D:\customers\Firmware\LPRS_lib\Header\lprs_public.h"的第41行声明)
#148声明与"uint config_comm(struct confComm *)"不兼容(在"D:\customers\Firmware\LPRS_lib\Header\lprs_public.h"的第42行声明)
警告:
函数外部不显示#233-D 声明
函数外部不显示#233-D 声明
函数外部不显示#233-D 声明
函数外部不显示#233-D 声明
libc 源文件:
#include #include #include #include #include //#include "lprs_public.h" #include "lprs_private.h" //函数 char radioBusyPinConfig (struct busyPin *s_P) { char v、k; V = 1 <<(s_P->引脚); 交换机(s_P->port) { 案例1: P1DIR &=~v; k = P1IN & v; 中断; 案例2: P2DIR &=~v; k = P2IN & v; 中断; 案例3: P3DIR &=~v; k = P3IN & v; 中断; 案例4: P4DIR &=~v; k = P4IN & v; 中断; 情况5: P5DIR &=~v; k = P5IN & v; 中断; 案例6: P6DIR &=~v; k = P6IN & v; 中断; 默认值: 中断; } 返回 k; } 。。
私有头文件:
#include "lprs_public.h" struct confTimer { char tmr[3]; 字符 CCR[2]; char cnt_length[3]; UINT countValue; }; struct confComm { 字符端口[3]; char clkFrq[9]; char 波特率[6]; }; struct busyPin { int 端口; INT 引脚; };
公共头文件:
typedef unsigned int uint; typedef unsigned char uchar; uchar * radioMachine (char * pcd); uint * config_timer (conft Timer * CT 、const char * dir); uint config_commt (struct confComm * CC); char BusyPinConfig (struct pin *);