PORTB = ~0xff;
created this warning:
main.c:217: warning: large integer implicitly truncated to unsigned type
o It's easy to fix but should this warning be generated?
I think I can see what's happening;
PORTB = ~0x02; // generates this in the list:
199 008e 8EEF ldi r24,lo8(-2)
200 0090 88BB out 56-0x20,r24
PORTB = ~0xff; // generates this in the listing:
222 00ae 18BA out 56-0x20,__zero_reg__
So __zero_reg__ must be 16 bit? casting ~0xff to uint8_t works fine as does setting it to a positive value, 0x00 instead of inverting. I only inverted because it was easier to read. The LEDs on the SK500 are negative logic. It is only a warning after all and not an error. (like stop lights, they're just a suggestion).