which compiled fine... however, I realised that I had put my stucture in the wrong order. I then carried out the, what I thought was, relatively simple task of re-ording the struct to produce:
which does NOT compile! giving the error "Error 35... Line 132(17,18): Number of bits is out of range" where line 132 is the line with "unsigned dataH".
Any ideas!?
Thanks,
Shaun
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
Posted: Tue Oct 24, 2006 8:31 am
I think it is complaining because they need to line up on byte borders
unsigned dataI: 2;
unsigned dataH: 6;//8
unsigned dataG: 4;//last 4 can trail off i think
or you will have to read them in, then make a shift and mask to put them is the data area you want. Perhaps a union will work here?? will a union work with bit places??
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