C:KYE.C(17): error C267: 'update_pca9635': requires ANSI-style prototype
在main.c中的主函数外定义了一个数组。
unsigned char code ab[]={0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X01,0X00,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X01,0X01,0X01,0X00,0X01,0X01,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,0X00,0X01,······
void main(void)
{
init_pca9635();
pause();
update_pca9635(ab); 这里报C:KYE.C(17): error C267
while(1);
}
===========================================================
update_pca9635(ab);定义在另一个 c文件中 。并且这个文件使用了extern code ab[];
void update_pca9635(unsigned char pic[])
{
unsigned char n;
start_i2c();
SendByte_init(0xe0);
SendByte_init(0xa2);
SendByte_init(0x81);
SendByte_init(0x05);
for(n=0;n<201;n=n+8)
{
SendByte(pic[n+0],pic[n+1],pic[n+2],pic[n+3],pic[n+4],pic[n+5],pic[n+6],pic[n+7]);
}
stop_i2c();
}
大侠们看看问题在哪里···
要是把代码写到一个c文件就不会报错
在线等那
update_pca9635 函数有没有在main.c文件里声明?
-----------------------------------------------------------------------
加了类型也通不过··
在h文件里面声明了。 main.c 引用的h文件
、】
-----------------------------------------------------------------------
马上
#include "pca_9635.h"
实际头文件 pca9635.h
一个警告都不要放过。。。
一周热门 更多>