|
Post by mutantcaterpillar on Mar 16, 2017 16:24:36 GMT
Hi,
I need to store a set of triple-byte structs in a contiguous RAM space. E.g.:
struct triplebyte
{
uint8_t a;
uint8_t b;
uint8_t c;
};
struct triplebyte data[ 50 ];
I need data[ 1 ].a to be located in the byte after data[ 0 ].c. I've tried various combinations of #pragmas and attribute((aligned(1))) but although I can get a,b and c to be next to each other, I can't get each triple next to each other.
How can this be done with this compiler?
Thanks!
|
|
|
Post by Admin on Mar 16, 2017 16:44:01 GMT
You might have to contact support@hightec-rt.com about this one!
|
|
|
Post by mutantcaterpillar on Mar 20, 2017 9:23:37 GMT
Sorted.  It needed __attribute__((packed)) on every element as well as the outermost braces (which I missed, because the actual code is a lot more convoluted than the rather simplified example I gave above).
|
|