|
哪個(gè)大佬幫看看這個(gè)該怎么改啊,頭文件加進(jìn)去了又出現(xiàn)了這種錯(cuò)誤,謝謝
#include<AT89x51.h>
gpio.h(3): error C202: 'P0M1': undefined identifier
gpio.h(3): error C202: 'P0M0': undefined identifier
gpio.h(3): error C202: 'P1M1': undefined identifier
gpio.h(3): error C202: 'P1M0': undefined identifier
gpio.h(4): error C202: 'P2M1': undefined identifier
gpio.h(4): error C202: 'P2M0': undefined identifier
gpio.h(4): error C202: 'P3M1': undefined identifier
gpio.h(4): error C202: 'P3M0': undefined identifier
#include<intrins.h>
#include"gpio.h"
#define uint unsigned int
#define uchar unsigned char
#define x P1
#define y P3
#define z P2
void main(void)
{
gpio();
x=0xff;
y=0xff;
while(1)
{
z=~(x^y);
}
}
gpio.h
gpio()
{
P0M1=0;P0M0=0;P1M1=0;P1M0=0;
P2M1=0;P2M0=0;P3M1=0;P3M0=0;
P4M1=0;P4M0=0;P5M1=0;P5M0=0;
}
|
|