I've got a problem.... I would make a int32 with four int8..but it's doesn't work and i don't understand why....
Can you help me ???
int32 value;
int8 a;int8 b;int8 c; int8 d;
value = d;
value= value<<8;
value = value + c;
value = value <<16;
value = value + b;
value = value <<24;
value = value + a;
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
Posted: Mon Sep 21, 2009 3:41 am
Look sharp. The d value is e.g. shift left by 48 bit positions in your code.
Use the CCS built-in function make32() to perform the conversion without overhead.
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
Re: make int32 with four int8
Posted: Tue Sep 22, 2009 2:01 am
make32(MSB,a,b,LSB); is your best bet. _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D
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 vote in polls in this forum