Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: typecast arm7 problem
PostPosted: Wed Jul 29, 2009 5:10 pm 
Offline

Joined: Wed Jul 29, 2009 5:06 pm
Posts: 2
Hi

I use eclipse+yagarto+the exemple getting-started-project-1.3-at91sam7x-ek or RTOS "ARM7_AT91SAM7X256_Eclipse". I have a problem when I do this
char var1[2];
int short var2 = 0x1234;

*(int short*)var1 = var2

When I do the typecast the arm stop working if the address is odd. Can you tell me why the arm his not able to do that and how I can solve my problem, because with the Rabbit I was able to do that. I know I can use memcpy, but with this cast I save some CPU time.


Top
 Profile  
 
 Post subject: Re: typecast arm7 problem
PostPosted: Fri Jul 31, 2009 7:31 am 
Offline

Joined: Fri Oct 19, 2007 10:18 am
Posts: 40
What happens if you cast the address of the first element?
Code:
*(int short*)(&var1[0]) = var2


Top
 Profile  
 
 Post subject: Re: typecast arm7 problem
PostPosted: Fri Jul 31, 2009 1:45 pm 
Offline

Joined: Wed Jul 29, 2009 5:06 pm
Posts: 2
that doesn't work, it happen the same thing that my cast


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: