We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I have a problem with struct compile, and I need your help. Thanks so much.
I have a register (32 bits) that is defined as a struct:
typedef struct {
int field_1 : 1;
int field_2 : 1;
int field_3 : 6;
int field_4 : 8;
int field_5 : 16;
} reg_t;
When I read/write the fileds in this struct, the compiler uses LDRB/STRB instruction. However, the register interface only supports 32b access.
How can I force the compiler to only use LDR/STR for this struct type?