#define uint unsigned int
#define WPKEY 7
#define UVKEY 0
#define IRKEY 1
#define PLKEY 2
#define TRKEY 3
#define ZMKEY 4
#define ZMAKEY 5
#define MSKEY 6
//#define YJFWKEY 4
//#define PIAOJUKEY 0
#define CHECK 0
#define CURRENCY 5
#define DMN 4
#define Vesion 7
#define BILL 2
#define EUR 3
#define RMB 6
#define USD 1
#define PhotoLeft 1
#define PhotoRight 2
#define PhotoUp 3
#define PhotoDown 4
#define TH0TEMP (65536-51035)/256
#define TL0TEMP (65536-51035)%256
#define Sec_1 20 //1Ãë
#define Sec_2 2*Sec_1
#define Min_1 60*Sec_1 //1·ÖÖÓ
#define Min_2 2*Min_1
#define KeyLongTime Sec_1
#define WhiteMoveTime 20
#define IRChangeTime 20
#define JGChangeTime 10
#define IRCUTCHANGRTIME 7
#define LEDFLASHTIME 10
#define ChargeShantime 10
#define ShutDownTime 30*Min_1 //30·ÖÖÓ
#define CloseLightTime 10*Min_1 //10·ÖÖÓ
uchar Ir_Cut_Posiont=0;
uchar multiple=0;
uchar IR_Cut_Count = 0;
uchar NUM = 1;
uchar Vesion_temp = 0;
uchar BACK_temp = 0;
uchar CHECK_Flag = 0;
uchar PLKEY_Flag = 1;
uchar CUR_Flag = 0x0c;
uchar DMN_Flag = 0x01;
uchar VES_Flag = 0x01;
uchar DIR_Flag = 0x01;
uchar light_temp = 0x01;
uchar NEXT_temp = 0;
uchar front_temp = 0;
uchar contrary_temp = 1;
uchar Key1_Frequency=0;
uchar Key2_Frequency=0;
uchar Key3_Frequency=0;
uchar Key4_Frequency=0;
uchar Key5_Frequency=0;
uchar Key6_Frequency=0;
uchar Key7_Frequency=0;
uchar Key8_Frequency=0;
uchar Key9_Frequency=0;
uchar Key10_Frequency=0;
uchar Key11_Frequency=0;
uchar Key12_Frequency=0;
uchar Key13_Frequency=0;
uchar Key14_Frequency=0;
uchar Key15_Frequency=0;
uchar Key16_Frequency=0;
uchar key_z=0;
uchar key_zbuk=0;
uchar key_zoomj=0;
uchar Key1_HF =0;
uchar Key2_HF =0;
uchar Key3_HF =0;
uchar Key4_HF =0;
uchar Key5_HF =0;
uchar Key6_HF =0;
uchar Key7_HF =0;
uchar Key9_HF =0;
uchar Key10_HF =0;
uchar Key11_HF =0;
uchar Key12_HF =0;
uchar Key13_HF =0;
uchar Key14_HF =0;
uchar Key15_HF =0;
uchar Key16_HF =0;
uchar tp_Key0 =1;
uchar UV_Key1 =1;
uchar Led_Flash = 0;
uchar TR_key=0;
uchar KeyLong=KeyLongTime;
uchar WhiteMove=WhiteMoveTime;
uchar IRChange=IRChangeTime;
uchar JGChange=JGChangeTime;
uchar ChargeTime=ChargeShantime;
uint ClosePower=0;
uint UVATKtime=0;
uint pz_yj=0;
uchar VideoSoFlag = 0;
uchar Video_cut=1;
uint buzzer_C=0;
uint buzzer_T=0;
uchar bdata U1_data;
uchar bdata U2_data;
uint sensor_stat=0x62;
uchar bdata U3_data;
uchar bdata U4_data;
sbit BOT_IR =U1_data^0;
sbit BOT_white =U1_data^1;
//sbit UV254_A =U1_data^2;
//sbit UV365_A =U1_data^3;
// sbit POWR_ON =U1_data^4;
sbit LENS_A_P =U1_data^5;
sbit LENS_B_N =U1_data^6;
sbit LENS_A_N =U1_data^7;
// sbit LCD_KEY =U2_data^0;
sbit TOP_white =U2_data^1;
sbit TOP_ir940 =U2_data^2;
sbit TOP_ir850 =U2_data^3;
sbit PC1089 =U2_data^4;
sbit MAX_a1 =U2_data^5;
sbit MAX_a2 =U2_data^6;
sbit MAX_en =U2_data^7;
sbit PL_KEY0 =U3_data^0;
sbit PL_KEY1 =U3_data^1;
sbit PL_KEY2 =U3_data^2;
sbit PL_KEY3 =U3_data^3;
sbit PL_KEY4 =U3_data^4;
sbit PL_KEY5 =U3_data^5;
sbit PL_KEY6 =U3_data^6;
sbit PL_KEY7 =U3_data^7;
sbit PL_KEY8 =U4_data^0;
sbit PL_KEY9 =U4_data^1;
sbit PL_KEY10 =U4_data^2;
sbit PL_KEY11 =U4_data^3;
sbit PL_KEY12 =U4_data^4;
sbit PL_KEY13 =U4_data^5;
sbit PL_KEY14 =U4_data^6;
sbit PL_KEY15 =U4_data^7;
sbit pb_GPIO0 = P1^6;
sbit pb_GPIO1 = P4^2;
sbit pb_GPIO11 = P1^0;
sbit pb_GPIO12 = P1^1;
sbit pb_GPIO5 = P1^2;
sbit pb_GPIO14 = P1^3;
sbit pb_GPIO6 = P1^4;
sbit pb_GPIO9 = P0^0;
//////////////8_KEY/////////////////
sbit keydata0 =P2^7 ;
sbit keydata1 =P2^6 ;
sbit keydata2 =P2^5 ;
sbit TouchKey =P2^4;
//////////////2_KEY/////////////////
sbit key2data0 =P0^3 ;
sbit key2data1 =P0^2 ;
sbit key2data2 =P0^5 ;
sbit TouchKey2 =P2^0;
sbit key_led =P2^3 ;
sbit UV254_A =P2^1 ;
sbit UV365_A =P2^2 ;
sbit JG_LED =P3^2;
sbit BUK_LED =P3^3;
sbit Side_Ir =P0^7;
sbit Side_White =P0^6;
sbit LCD_KEY =P0^1;
sbit HC4094_SDATA =P3^6;
sbit HC4094_CP =P3^7;
sbit HC4094_LATCH =P3^5;
sbit HC4094_OE =P3^4;
sbit BUZ =P4^3;
sbit S_MCOR =P4^1;
sbit POWR_ON =P4^0;
sbit MG_MCOR =P1^5;
bit b_led_close =1;
bit B_IR_Mode=0;
bit B_white_Mode=0;
bit B_JG_Mode =0;
bit JG_ss =0;
bit ZDBF_KEY =0;
bit ATK_stat =0;
bit B_Charge_Mode=0;
bit B_test =0;
bit white_on =0;
bit key_zkey =0;
bit key_66 =0;
bit key_wj510 =0;
bit key_wj1089=0;
bit key_MSkey =0;
bit key_IRkey =0;
bit key_yjfw =0;
bit key_yjfwA =0;
bit key_check =0;
bit key_currenuy =0;
bit key_dmn =0;
bit key_vesion = 0;
bit key_back = 0;
bit key_next = 0;
bit key_up =0;
bit key_down =0;
bit key_test1 =0;
bit key_test2 =0;
bit key_test3 =0;
bit key_test4 =0;
bit key_PCCAM =0;
bit MSkey_long =0;
bit MSAkey_long =0;
bit UVkey_long =0;
bit ZMkey_long =0;
bit WPkey_long =0;
bit WPAkey_long =0;
bit IRkey_long =0;
bit ZMAkey_long =0;
bit ZMBkey_long =0;
bit ZMCkey_long =0;
bit YJFWkey_long=0;
bit TRkey_long =0;
bit PLkey_long =0;
bit PLAkey_long =0;
bit PZkey_long =0;
bit CHECKkey_long =0;
bit CURRENCYkey_long =0;
bit DMNkey_long =0;
bit Vesionkey_long =0;
bit BACKkey_long =0;
bit NEXTkey_long =0;
bit UPkey_long =0;
bit DOWNkey_long =0;
//bit Buz_flag = 0;
bit B_Sleep =0;
bit A_Sleep =0;
bit B_IR_Cut =0;
bit en_buzzer =0;
bit pccam0 =0;
void initiate_RS232(void);
void Send_Byte(uint one_Byte);
void init_sys(void);
void ClearFlag();
void send_data_4094(void);
void init_Timer();
void CloseTimer0();
void OpenTimer0();
void ZOOM_Photo();
void Shutter_Photo();
void KeyDispose();
void KeyDispose2();
void Down_data( );
void UP_data( );
void Left_data( );
void Right_data( );
void Shutdown();
void LX_Photo_mode();
void GUANJI_Photo();
void jaihuan_Photo_mode();
void ZOOMA_Photo();
void HF_Photo_mode();
void Top_White_K();
void Top_IR_940_K ();
void Top_IR_850_K ();
void Uv_254_K ();
void Uv_365_K ();
void Side_White_K();
void Side_Ir_K ();
void White_bott_K ();
void IR_bott_K ();
void Lask_K ();
void Buk_K ();
void Video_S_PC1089 ();
void Video_S_PC1030 ();
void Video_S_S510 ();
void Video_S_S120 ();
//void DSP_KEY_G();
void IO_GUANG () ;
void buzzer_ctr( );
void Video_Power_G ();
void WakeUp();
void WAKEUP1();
void init_Key_long ();
void _dsp_cmd( uchar c_cmd);
void _dsp_cmd2( uchar c_cmd);
void _dsp_cmd3( uchar c_cmd);
void _dsp_cmd4( uchar c_cmd);
void delayms(uint delay);
void init_Key_Frequency();
void init_Key_HF();
void KeyScan();
void Lens_Off ();
void LensCutA();
// void LensCutAS();
void Video_Power_K ();
void KeyDispose3(void);
void Shortcut_Select1(uchar cmd1,uchar cmd2,uchar cmd3,uchar cmd4,uchar cmd5);
keil4编译后的错误提示
Rebuild target “Target 1”
compiling main.c…
compiling model.c…
MAIN.H(169): error C202: “P1”: undefined identifier
MAIN.H(170): error C202: “P4”: undefined identifier
MAIN.H(171): error C202: “P1”: undefined identifier
MAIN.H(172): error C202: “P1”: undefined identifier
MAIN.H(173): error C202: “P1”: undefined identifier
MAIN.H(174): error C202: “P1”: undefined identifier
MAIN.H(175): error C202: “P1”: undefined identifier
MAIN.H(176): error C202: “P0”: undefined identifier
MAIN.H(178): error C202: “P2”: undefined identifier
MAIN.H(179): error C202: “P2”: undefined identifier
MAIN.H(180): error C202: “P2”: undefined identifier
MAIN.H(181): error C202: “P2”: undefined identifier
MAIN.H(183): error C202: “P0”: undefined identifier
MAIN.H(184): error C202: “P0”: undefined identifier
MAIN.H(185): error C202: “P0”: undefined identifier
MAIN.H(186): error C202: “P2”: undefined identifier
MAIN.H(188): error C202: “P2”: undefined identifier
MAIN.H(189): error C202: “P2”: undefined identifier
MAIN.H(190): error C202: “P2”: undefined identifier
MAIN.H(192): error C202: “P3”: undefined identifier
MAIN.H(193): error C202: “P3”: undefined identifier
MAIN.H(195): error C202: “P0”: undefined identifier
MAIN.H(196): error C202: “P0”: undefined identifier
MAIN.H(198): error C202: “P0”: undefined identifier
MAIN.H(200): error C202: “P3”: undefined identifier
MAIN.H(201): error C202: “P3”: undefined identifier
MAIN.H(202): error C202: “P3”: undefined identifier
MAIN.H(203): error C202: “P3”: undefined identifier
MAIN.H(204): error C202: “P4”: undefined identifier
MAIN.H(205): error C202: “P4”: undefined identifier
MAIN.H(206): error C202: “P4”: undefined identifier
MAIN.H(207): error C202: “P1”: undefined identifier
compiling dsp.c…
Target not created
60
undefined identifier是常见的keil编译错误
引发这一错误的原因是你使用的变量没有被定义
常见的处理手段是对你使用到的变量进行变量定义
另外一种常见的错误就是大小写导致的
如你定义的是unsigned char num;
在使用的时候,写成了NUM,也会出现同样的错误。
10