Keil and structure pointers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-04-06 8:11 AM
Keil and structure pointers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
What exactly ''does not work''? Does it fail to compile or does it fail to do what you expect at run time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
''it does not work''
What, exactly, does not work? How, exactly, does it fail? Do you understand the issues of data alignment - and, hence, why compilers often add padding to structures...?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
And how exactly are you testing this, and coming to this conclusion?
int main () { /* cast buffer to hdr struct */ hdr = ( header1*)usart_buffer; usart_buffer[0] = 0xE5; printf(''%02X\n'',hdr->glcd[0]); }Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
''it does not do !''
How, exactly, do you know that? What, exactly, does it do? Again: Do you understand the issues of data alignment - and, hence, why compilers often add padding to structures...?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
I checked google for data alignment nd padding but still confused could you explain please and what is the relation with my problem .
Thank you all .- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
Why do you have to make it so hard to wring the information out of you?
Just saying ''it doesn't work'' or ''it's wrong'' is virtually useless - it's like saying, ''my car doesn't work - what's wrong with it?'' You need to explain precisely how it's wrong, or how it doesn't work''I cant see the right result'' So what result, exactly, do you see? Have you compared the actual result, and the expected result, and thought about the difference - and how you could explain it?Data Aligbnment refers to the requirement that most processors have for data items bigger than 1 byte to start on certain addresses; eg, 2-byte objects need to start on an even address, so that they can be fetched in a single operation; 4-byte objects need to start on a 4-byte boundary, so that they can be fetched in a single operation; But 1-byte objects can start on any arbitrary address. It should be obvious that this is going to cause issues if you try to mess with pointers where the target objects have different alignment requirements...A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-05-17 5:30 AM
http://en.wikipedia.org/wiki/Data_structure_alignment
A complex system designed from scratch never works and cannot be patched up to make it work.
