This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can anybody here explain this problem?

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.