One HAL head file: /**********************************/ #ifndef __HAL_H__ #define __HAL_H__ #define DATA_BUS P0 // sbit MCU_TXD = P1^0; // sbit MCU_RXD = P1^1; // sbit MCU_NC = P1^2; sbit D12_A0 = P1^3; sbit MCU_INT1 = P1^4; // sbit MCU_RST = P1^5; sbit WR_N = P1^6; sbit RD_N = P1^7; sbit LED1 = P3^0; sbit LED2 = P3^1; #define A0_COMMAND D12_A0=1 #define A0_DATA D12_A0=0 #define DATABUS_READ(x) DATA_BUS = 0xFF; D12_RD_N = 0; x = DATA_BUS; D12_RD_N = 1 #define DATABUS_WRITE(x) D12_WR_N = 0; DATA_BUS = x; D12_WR_N = 1 #define DISABLE EA=0 #define ENABLE EA=1 #endif /**********************************/ While compiling, it is reported that on every C file containing the head file: ERROR C231:'D12_A0' redifinition ERROR C231:'WR_N' redifinition ERROR C231:'RD_N' redifinition No other place in the project define these three, I have searched for within but no discovery. If i rem all definitions but these three in this head file, nothing change. If i merely rem these three and left others untouch, no compiling error any more.
"Your problem may be because the 'header file is being processed more than once'." The preprocessor listing, as previously suggested, would confirm whether or not this is the case.
Hi,Andrew. Your advice is really directive. I have tried to see global marco definiton by "View->source browser" manu_item in Uv2.Howerver, if I did not compile the code successfully, I can not have a look on the definiton. That means if there is an error in code, i can not have a check. Is any way else to look the list that you said?
"I have tried to see global marco definiton by "View->source browser" manu_item in Uv2.Howerver, if I did not compile the code successfully, I can not have a look on the definiton." True - that's why I suggested that you use the preprocessor listing. "Is any way else to look the list that you said?" The preprocessor listing usually has a .i filetype; you enable it on the 'Listings' tab in the Project options.