Skip to main content
2 of 2
added 52 characters in body
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.

the busybee
  • 4.5k
  • 14
  • 25