Hi guys,
I'm currently working with a Cortex-M0 which is incapable of unaligned reads.
I have a byte array which is storing a received packet in a certain protocol, the first lot of information to come in is 1 byte, followed by two 16-bit half-words.
This is leading to misalignment and preventing me from performing any direct casting/pointer access to these values; I can't space the data out as it's being placed in the array by DMA.
I know with a structure it can be packed, however I've had no such luck with pointers and access to my array.
Is it possible to ask the compiler to align the start of my byte array on the edge of a word (3 bytes), so that the rest of my data is aligned? And if so how?
Any other suggestions?
Many thanks for any help and advice.
Thanks,
Was thinking I'd have to do this, a the incoming frame always starts in this format I'll be using pointers and then pack/unpack commands for data after this.
Cheers