I have the following struct:
union Word { uint16_t Word; uint8_t Byte[2]; struct { uint8_t Lo; uint8_t Hi; }; }; struct PKTStatus { bool Ack : 1; bool AckReq : 1 bool Resend : 1; uint8_t PktNo : 3 }; struct TMFPacketHeader { Word ReceiverAddress Word SenderAddress; PKTStatus Status; uint8_t CRC; uint8_t Size; };
When I try to debug using Simulator 2 (or 1, doesn't matter in this case) I have the following error in fields defined as bool:
So I changed bool to unsigned, now AVR Studio recognized type, but displayed values are incorrect "“ it seems that instead of displaying particular bitfield, AVR Studio displays Status field value:
Can anybody confirm the problem?