Skip to main content
added 52 characters in body
Source Link
the busybee
  • 4.5k
  • 14
  • 25

In addition to brhans' answer, you should define single SFR bits like this:

sbit led1 = P2^0; 

instead of this:

#define led1 P2^0 

The syntax with ^ is an extension of Keil C51, and it is only allowed in such definitions.

You did this already for other bits.

In addition to brhans' answer, you should define single SFR bits like this:

sbit led1 = P2^0; 

The syntax with ^ is an extension of Keil C51, and it is only allowed in such definitions.

You did this already for other bits.

In addition to brhans' answer, you should define single SFR bits like this:

sbit led1 = P2^0; 

instead of this:

#define led1 P2^0 

The syntax with ^ is an extension of Keil C51, and it is only allowed in such definitions.

You did this already for other bits.

Source Link
the busybee
  • 4.5k
  • 14
  • 25

In addition to brhans' answer, you should define single SFR bits like this:

sbit led1 = P2^0; 

The syntax with ^ is an extension of Keil C51, and it is only allowed in such definitions.

You did this already for other bits.