Hello All,
I am making a bitfiled structure as followed:
typedef struct{ uint8_t app1:1; uint8_t app2:1; uint8_t app3:1; uint8_t app4:1; uint8_t app5:1; uint8_t app6:1; uint8_t app7:1; uint8_t app8:1;
}STATUS_TYPE;
in my program I am accessing a bit and trying to ex-or it (status.app1^=1;), but while doing the bit operation, other bits are also changing (as i am observing from debug window). I have no idea why it is happening, i am a complete beginner.
I tried __attribute__((packed)) struct and __PACKED_STRUCT as well, but the same result. Please help.
IDE Info:
Hardware:
NUCLEO-F411RE having STM32F411RE controller, and i am using On-board STlinkV2 for debugging.
That is just a problem of how bit-fields are displayed in that Watch Window, check in the Memory Window if the bits in the byte are changing as expected.
Hey, Thanks a ton for helping. Seems this is the issue, because in memory window only corresponding bit is changing.
Thank you.