0
的臂 「的#pragma anon_unions」 允許:VisualStudio的eqivalent到ARM的#pragma anon_unions
typedef struct {
uint32_t sensorID;
uint8_t messageHeader;
uint8_t messageID;
uint16_t payloadLength;
} Header;
typedef struct {
uint8_t startOfPacket[SERIAL_SOP_SIZE];
Header; // Anonymous.
uint8_t payload[SIZE];
} Packet;
Packet packet;
packet.messageID = 1; // Referencing member of Header through a Packet.
在得到這個代碼的VisualStudio編譯任何想法?
乾杯 - 那讓我在那裏。 – Ricibob 2012-07-18 17:16:26