Daniel O'Connor wrote:
On Fri, 9 Dec 2005 10:52, Russell Shaw wrote:

Any help gratefully received!

Beware of structure padding leaving holes.

http://www.eskimo.com/~scs/C-faq/q2.12.html
http://www.eskimo.com/~scs/C-faq/q2.13.html

Hmm, I tried..
struct foo { uint8_t a;
        uint8_t b;
        uint8_t c;
        uint8_t d;
        uint8_t e;
    } __attribute__ ((packed)) abc = {
        1,
        2,
        3,
        4,
        5
    };

but there is no change in behaviour.

I would not expect GCC to pad [too much] on AVR anyway because the processor doesn't require aligned access.

Because i haven't got a running system to test it on, i can only infer
things at a distance. I can't see any bugs in the supplied code. Maybe
it's interaction or something being overwritten by another part of your
system?


_______________________________________________
AVR-chat mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to