用Codewarrior 写基于飞思卡尔的嵌入式程序时,提示 'PORTC' undeclared (first use in this function),明明已经定义了PORTC,且点击其名称时可以跳转到声明中
#include "common.h"
#include "light.h"
//主函数
int main(void)
{
//1 主程序使用的变量定义
uint32 runcount; //运行计数器
//2 关中断
DisableInterrupts; //禁止总中断
//3 模块初始化
light_init(Light_Run_PORT,Light_Run2,Light_ON); **//出错的地方**
light_init(Light_Run_PORT,Light_Run1,Light_OFF); **//出错的地方**
……
}
****要包含的头文件 #include "light.h"如下 ********
#include "common.h"
//2 宏定义
//2.1 灯控制引脚定义
#define Light_Run_PORT PORTC //运行指示灯使用的端口
#define Light_Run1 13 //运行指示灯使用的引脚
#define Light_Run2 14 //运行指示灯使用的引脚
```c#
错误提示:
'PORTC' undeclared (first use in this function) main.c /gpio/Sources line 23 C/C++ Problem
以为是在main.c中没有包含#include "light.h" ,添加了还是不行
报错提示是main.c的第23行有错误。你看一下23行到底是什麽代码啊