什么玩意编译器哦,怎么定义都是错的,请朋友帮忙看一下,谢谢
以下两种全局变量没哪一种可以通过的,编译时提示如下,
E:\DATE\EMIR\emir.c(95): error: undeclared identifier `irtime'
E:\DATE\EMIR\emir.c(140): error: undeclared identifier `irh'
其它寄存器提示同上
//========================================
#include "EM78P153S.H"
//#include "clrram.h"
//======================================================
//---------------脚位定义-------------------------------
#define jir P65 //IR信号输入
#define pnp_out P62 //驱动脚输出
#define NOP() _asm{nop}
#define WDTC() _asm{wdtc}
//=======================================================
unsigned char [email=ir_h@0x20]ir_h@0x20[/email]: bank 1; // ir高位地址
unsigned char [email=ir_l@0x21]ir_l@0x21[/email]: bank 1; // ir低位地址
unsigned char [email=ir_d@0x22]ir_d@0x22[/email]: bank 1; // ir数据码
unsigned char [email=ir_f@0x23]ir_f@0x23[/email]: bank 1; // ir数据反码
unsigned char [email=ir_time@0x24]ir_time@0x24[/email]: bank 1; // ir时限计数器
unsigned char [email=ir_32@0x25]ir_32@0x25[/email]: bank 0; // 判断ir循环器
unsigned char [email=gIrh@0x26]gIrh@0x26[/email]: bank 0;
unsigned char [email=gIrl@0x27]gIrl@0x27[/email]: bank 0;
unsigned char [email=gIrd@0x28]gIrd@0x28[/email]: bank 0;
unsigned char [email=gIrdl@0x29]gIrdl@0x29[/email]: bank 0; //数据码低四位
unsigned char [email=IR_ADDRH@0x2a]IR_ADDRH@0x2a[/email]: bank 0;
unsigned char [email=IR_ADDRL@0x2b]IR_ADDRL@0x2b[/email]: bank 0;
unsigned char [email=flash_ird@0x2c]flash_ird@0x2c[/email]: bank 0; //暂存IRD数
/*
unsigned char ir_h; // ir高位地址
unsigned char ir_l; // ir低位地址
unsigned char ir_d; // ir数据码
unsigned char ir_f; // ir数据反码
unsigned char ir_time; // ir时限计数器
unsigned char ir_32; // 判断ir循环器
unsigned char gIrh;
unsigned char gIrl;
unsigned char gIrd;
unsigned char gIrdl; //数据码低四位
unsigned char IR_ADDRH;
unsigned char IR_ADDRL;
unsigned char flash_ird; //暂存IRD数
*/
bit bir_l; //连接标志
bit bir;
bit bExit;
//************************************************
//================初始化程序======================
void safeguard_init1()
{
RSR=0B00000000; //0x04,选择BANK0
P5CR=0; //端口控制寄存器,设置为输出
P6CR=0B11111011; //P6端口控制器,除P62为输出外,基它脚作为输入
PORT5=0; //P5端口寄存器,输出为0
PORT6=0B11111011; //P5端口寄存器,输出为0
ir_h=0;
}
//*******************************************************
void delay(unsigned char x)//48ms
{
unsigned char i;
while(x--)
{
for (i = 0; i<3; i++)
{
}
}
}
//***************************************************
void Ir(void)
{
}
//=========================================================
void main()
{
Ir();
}
void _intcall interrupt_l(void) @ 0x08:low_int 0
{
_asm
{
//save A --> 0x1F ; R3 --> 0x2E ; R4 --> 0x2F
MOV 0X1F,A ;backup A to 0x1F
SWAPA 0X04 ;backup R4 to 0x2F
MOV 0X2F,A ;backup R4 to 0x2F
SWAPA 0X03
MOV 0X2E,A ;backup R3 to 0x2E
}
}
void _intcall interrupt(void) @ int 0
{
//backup C system
/* _asm
{
MOV A,0X10 //Depend on WicePlus reports in information window, Output window
MOV 0X2C+1,A
MOV A,0X11
MOV 0X2B+1,A
MOV A,0X12
MOV 0X2A+1,A
MOV A,0X13
MOV 0X29+1,A
MOV A,0X14
MOV 0X28+1,A
}
*/
// Write your code (inline assembly or C) here
//restore C system
/* _asm
{
MOV A,0X2C+1 //Depend on WicePlus reports in information window, Output window
MOV 0X10,A
MOV A,0X2B+1
MOV 0X11,A
MOV A,0X2A+1
MOV 0X12,A
MOV A,0X29+1
MOV 0X13,A
MOV A,0X28+1
MOV 0X14,A
}
*/
//restore ACC,R3,R4
_asm
{
SWAPA 0X2E ;restore R3
MOV 0X03,A
SWAPA 0X2F ;restore R4
MOV 0X04,A
SWAP 0X1F ;restore A
SWAPA 0X1F
}
} |