4 ms·
On an AVR if you write this in C PORTB |= (1<<4); You get this in assembly sbi PORTB, PINB4 However if you write PORTB = PORTB | (1<<4)l The compile
by Gibbon1 5y ago
On an AVR if you write this in C
PORTB |= (1<<4);
You get this in assembly
sbi PORTB, PINB4
However if you write
PORTB = PORTB | (1<<4)l
The compiler instead emits.
sbi PORTB, PINB4
I ported some code once where they went to the trouble of defining the registers as bit fields. In that case
portb.pin4 = 1;
compiled to
sbi PORTB, PINB4