??? 01/18/10 22:11 Read: times Msg Score: -1 -1 Answer is Wrong |
#172572 - "sbit MTRS=P2^0;" is not OK here Responding to: ???'s previous message |
sbit MTRS=P2^0;Is not what you want. It would assign the value of P2 (xor'ed with zero, then converted to int, then converted to bit) to sbit MTRS at program startup. The value of P2 is not known at compile time, SDCC should have bailed out with: servo_1.c:3: error 2: Initializer element is not constant Are you using/testing a stale .ihx file? Use: #define MTRS P2_0 #define MTRE P2_1 #define MTRW P2_2 #define MTRH P2_3instead of: sbit MTRS=P2^0; sbit MTRE=P2^1; sbit MTRW=P2^2; sbit MTRH=P2^3; |