union with struct overlaying with U32 & array of 2 U16
U32 & 2 U16s show ok
struct doesn't but all show as the same address [ as you would expect ]
typedef union
{
struct
{
uint32_t PowerEnable : 1;
uint32_t Startup : 1;
uint32_t Fault : 1;
uint32_t HwFault : 1;
uint32_t Present : 1;
uint32_t xExpanderPresent : 1;
uint32_t xExpanderOk: 1;
uint32_t : 1;
uint32_t xChargerPresent : 1;
uint32_t xChargerOk : 1;
uint32_t SmartBattPresent : 1;
uint32_t SmartBattOk : 1;
uint32_t : 4;
uint32_t HwFaultShadow : 1;
uint32_t Updated : 1;
uint32_t Channel : 1;
} ;
uint32_t u32;
uint16_t aU16[2];
} UnBatteryStatusReg;
U32 & 2 U16s show ok
struct doesn't but all show as the same address [ as you would expect ]
typedef union
{
struct
{
uint32_t PowerEnable : 1;
uint32_t Startup : 1;
uint32_t Fault : 1;
uint32_t HwFault : 1;
uint32_t Present : 1;
uint32_t xExpanderPresent : 1;
uint32_t xExpanderOk: 1;
uint32_t : 1;
uint32_t xChargerPresent : 1;
uint32_t xChargerOk : 1;
uint32_t SmartBattPresent : 1;
uint32_t SmartBattOk : 1;
uint32_t : 4;
uint32_t HwFaultShadow : 1;
uint32_t Updated : 1;
uint32_t Channel : 1;
} ;
uint32_t u32;
uint16_t aU16[2];
} UnBatteryStatusReg;