求救 C:KYE.C(17): error C267: 多个文件调用一个数组的问题

2020-02-04 09:36发布

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文件就不会报错
在线等那
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。