I have a typedef'ed struct which currently looks like this:
typedef struct Sys_Inject
{
uint16_t num;
uint16_t alternative;
uint8_t delay;
uint8_t thresh;
uint8_t reserved[2];
BOOL32 state;
options_select_t sel;
uint32_t per;
} Sys_Inject_t;
I want to get rid of the elements BOOL32 state; and options_select_t sel; and define them inside the uint8_t reserved[2] array such that reserved[0] = state and reserved[1] = sel. BOOL32 is defined in another module as:
typedef BOOL32 (*FScallback_t)(uint32_t);
Also options_select_t is an enum and is defined as:
typedef enum options_select_e
{
TEST_DEFAULT = 0,
TEST_CURRENT,
TEST_SAVED,
}options_select_t;
What is the actual size of BOOL32 in this case? Is it 32 bits? Also, is the size of the enum 8 bits for each element?
Note that reserved is an array with two elements, so it is 16 bits in total. How do I fit the two elements state and sel in it?