From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23452 invoked by alias); 10 Jan 2008 10:29:13 -0000 Received: (qmail 23443 invoked by uid 22791); 10 Jan 2008 10:29:13 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.177) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 10 Jan 2008 10:28:47 +0000 Received: by wa-out-1112.google.com with SMTP id l24so1091621waf.22 for ; Thu, 10 Jan 2008 02:28:43 -0800 (PST) Received: by 10.114.126.1 with SMTP id y1mr2081759wac.25.1199960923184; Thu, 10 Jan 2008 02:28:43 -0800 (PST) Received: by 10.115.109.11 with HTTP; Thu, 10 Jan 2008 02:28:43 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 10:29:00 -0000 From: Alexandre Reply-To: thekyz@gmail.com To: "EXTERNAL Gladis Olaf (Praktikant, CR/AEM)" Cc: "Paul D. DeRocco" , ecos-discuss@ecos.sourceware.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <015801c85322$bf2055e0$887ba8c0@PAULD> X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: pragma pack X-SW-Source: 2008-01/txt/msg00040.txt.bz2 Thanks for the link ^^ I'm a bit dumb when dealing with that kind of things. The problem is when I put the data in flash and read it thereafter, I obtain the value 768 for timestamp, which is 300 in hex. I must have made something wrong there ... On Jan 10, 2008 11:06 AM, EXTERNAL Gladis Olaf (Praktikant; CR/AEM) wrote: > > > -----Original Message----- > From: ecos-discuss-owner@ecos.sourceware.org > [mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Alexandre > Sent: Donnerstag, 10. Januar 2008 10:43 > To: Paul D. DeRocco > Cc: ecos-discuss@ecos.sourceware.org > Subject: Re: [ECOS] Re: pragma pack > > > Actually i had some problems accessing my packed structures without > > flows, I think that may help resolve things a bit. > > Eg with things like that: > > > > cyg_uint8 i = 0; > > struct s_pelco_pattern_array a; > > > > a.command2_byte = i++; > > a.data3 = i++; > > a.data4 = i++; > > a.timestamp = i; > > > > I finish having a structure which looks like this in memory: > > > > cm2: 0x00 > > data3: 0x01 > > data4: 0x02 > > ts: 0x0300 > > > > Which is really not what i want to have eventually. > > > > I would say this looks correct. > Maybe you thought there must be 0x0003 in the last one? > > But if you have a little endian CPU it swaps the bytes. > If you have more questions about Endianness take a look at > > http://en.wikipedia.org/wiki/Endianness > > Greets olaf > -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss