example was incorrect for what was asked... and where is this in the help file?Quote:
you mentioned the aligned attribute... can someone explain how i should impliment that... suppose i have char U1rx_inbox[1024]; and i want that to be aligned as if it where and array of 256 Uint32's ?
You can use it in this way :
Code: Select all
unsigned long xyz[1024] aligned(32);
We have covered this in the help file, please check it out.
Odd problems when running code
Re: Odd problems when running code
Re: Odd problems when running code
Hi,
Type Variable Attributes in the index search and the topic will open.
Regards,
Filip.
Type Variable Attributes in the index search and the topic will open.
Regards,
Filip.
Re: Odd problems when running code
why 16 and 32 BYTE boundaries. why not 4 byte boundary? starting to feel like i hijacked this post and getting the run around as punishment. its a simple thing really, when ever i create a char array i want to ensure its first element is located at a hex address that ends in ( 0,4,8,C ). if 16 and 32 byte boundaries are the correct way to do it could someone explain. at first impression it seems people pick aligned 16 and 32 thinking they are bits.Variable Attributes
The variable attributes aligned and packed are optional in declarations and do not actually affect the type of variable.
Attribute aligned
This attribute specifies a minimum alignment for the variable or structure field, measured in bytes. For example, the declaration :
int x aligned(16);
or alternative syntax :
int x __attribute__ ((aligned(16)));
This will cause the compiler to allocate the global variable x on a 16-byte boundary.
The aligned attribute can only increase the alignment, but you can decrease it by specifying packed as well.
Re: Odd problems when running code
Yep you've achieved exactly what the ME people wanted. You've moved the descussion onto something they can point to in their help file, it doesn't help you or me but at least they can say they've done their bit and provided answers on the forum.
Notice as well that even your question on bits/bytes as been left hanging, by the way I didn't think it sounded right either but I'm desperate and still haven't got a solution to my original problem.
Notice as well that even your question on bits/bytes as been left hanging, by the way I didn't think it sounded right either but I'm desperate and still haven't got a solution to my original problem.