C语言warning C206 missing function-prototype

missing function-prototype

单片机程序,引用DelayMs,

  while (1) {
    //ShellMain();
    printf("hello world\r\n");
    DelayMs(1000);
  }

报错,

Build target 'Target 1'
compiling main.c...
..\src\main.c(26): warning C206: 'DelayUs': missing function-prototype
..\src\main.c(26): error C267: 'DelayUs': requires ANSI-style prototype
Target not created

明明已经实现了这个函数,后来发现是头文件的预编译宏和另外一个文件重复,

#ifndef __PCA_H_
#define __PCA_H_

void DelayUs(unsigned long us);
void DelayMs(unsigned long ms);

#endif

更改为,

#ifndef __DELAY_H_
#define __DELAY_H_

void DelayUs(unsigned long us);
void DelayMs(unsigned long ms);

#endif
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章