How do I declare an array of structs with one element a byte aligned array of uint8_t
I'm trying to clean up some code I used to figure out how to use the UARTs on a STM32H7A3. The STM examples declares the data to be sent out like this:
ALIGN_32BYTES(uint8_t txBuffer[]) = " *****UART_TwoBoards comm ... ";
ALIGN_32BYTES is defined like this #define ALIGN_32BYTES(buf) buf __attribute__ ((aligned (32)))
I'd like to declare an array of struct like this:
struct Commands //TODO this should be const
{
uint8_t numBytes;
uint32_t timeout;
uint8_t cmd[];
};
Commands commands[numCmds];
but this: ALIGN_32BYTES(uint8_t command[PUBX00].cmd[]) = "$PUBX,00*33\r\n";
gives this error at the . between [PUBX00] and cmd[]
[Clang IntelliSense] Error: expected ';'
Any ideas how to fix this will be greatly appreciated
