I'm not sure either. The refactored code does not have any of the items people were posting about? Are you guys looking at the latest code? It's using the _BV(bit) macro to create bit masks. It's a lot more readable.
To set a bit you use:
PORTB |= _BV(PB1); // PORTB = PORTB | (00000010)
To clear a bit you use:
PORTB &= ~_BV(PB1); // PORTB = PORTB & (11111101)
Finally, you can set multiple bits at once:
PORTB |= | _BV(PB7) | _BV(PB1) | _BV(PB0); // PORTB = PORTB | (10000000) | 0000010) | (00000001)
FWIW,
Jay
Last edited by JayC; 06-08-2009 at 12:56 PM..
|