@danielchen thanks for helping!
So if I understand correctly, if my structure is:
typedef struct my_struct
{
uint16_t a;
uint16_t b;
uint8_t c;
} my_struct_t
That would be 40 bits only, therefore I would have to make my structure as:
typedef struct my_struct
{
uint16_t a;
uint16_t b;
uint8_t c;
uint8_t reserved[3];
} my_struct_t
To make it 64 bits and be able to use it, is this correct?
Then, should the array declaration and queue initialization be:
#define NUM_MESSAGES 3
#define MSG_SIZE 2 /* 2 because the struct is 64bits long, correct? */
uint32_t server_queue [sizeof(LWMSGQ_STRUCT)/sizeof(uint32_t) + NUM_MESSAGES * MSG_SIZE];
_lwmsgq_init((void *)server_queue, NUM_MESSAGES, MSG_SIZE);
Or, written in terms of the structure:
#define NUM_MESSAGES 3
#define MSG_SIZE sizeof(my_struct)/sizeof(_mqx_max_type)
uint32_t server_queue [sizeof(LWMSGQ_STRUCT)/sizeof(uint32_t) + NUM_MESSAGES * MSG_SIZE];
_lwmsgq_init((void *)server_queue, NUM_MESSAGES, MSG_SIZE);
Is this correct?