undefined identifier
#ifndef __DELAY_H__#define __DELAY_H__
#include <reg52.h>
#include "LCD Driver.h"
/************************************************
函数: delay_ms(unsigned int MS)
功能: 延时
*************************************************/
void delay_ms(unsigned int MS)
{
unsigned char i,j;
for(i = 0; i < MS; i++)
for(j = 0; j < 123; j++);
}
/************************************************
函数: delay_key(unsigned int second,unsigned int MS100)
功能: 延时和画面切换按键
*************************************************/
void delay_key(unsigned int second,unsigned int MS100)
{
unsigned int i;
for(i = 0; i < second*100 + MS100; i++)
{
if(key == 0)
{
delay_ms(20);
while(key == 0) {delay_ms(20);}
break;
}
else delay_ms(20);
}
}
#endif
#ifndef __DRIVER_H__
#define __DRIVER_H__
#include <reg52.h>
#include "Delay.h"
sbit CS = P2^7;
sbit REST = P3^1;
sbit RS = P2^0;
sbit WRD = P3^6;
sbit RDD = P3^7;
sbit key = P3^4;
#define LCM_DB P0
void Display_image();
void CMDWrite(unsigned char CMD);
void DataWrite(unsigned char DAT);
unsigned char DataRead(unsigned char Addr);
void Initinal();
.........
..........
#endif
错误:DELAY.H(30): error C202: 'key': undefined identifier
请问问大家,这个"key" 我在前面定义了为什么编译的时候这里会说没有定义呢?