From: Alexandre <thekyz@gmail.com>
To: "EXTERNAL Gladis Olaf (Praktikant,
CR/AEM)" <external.Olaf.Gladis@de.bosch.com>
Cc: "Paul D. DeRocco" <pderocco@ix.netcom.com>,
ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Re: pragma pack
Date: Thu, 10 Jan 2008 10:29:00 -0000 [thread overview]
Message-ID: <d5aafeec0801100228x3092127bx97bddddc7a5a1fa0@mail.gmail.com> (raw)
In-Reply-To: <F6E0DC7B316B5342918DD39721EE25B101C9FFF0@si-mail07.de.bosch.com>
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)
<external.Olaf.Gladis@de.bosch.com> 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
next prev parent reply other threads:[~2008-01-10 10:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-09 14:19 [ECOS] " Alexandre
2008-01-09 14:40 ` Andrew Lunn
2008-01-09 14:51 ` Bernard Fouché
2008-01-09 14:56 ` Alexandre
2008-01-09 21:55 ` Bronislav Gabrhelik
2008-01-09 22:22 ` Paul D. DeRocco
2008-01-09 23:50 ` [ECOS] " Grant Edwards
2008-01-10 0:50 ` Paul D. DeRocco
2008-01-10 9:43 ` Alexandre
2008-01-10 10:07 ` EXTERNAL Gladis Olaf (Praktikant; CR/AEM)
2008-01-10 10:29 ` Alexandre [this message]
2008-01-09 15:02 ` [ECOS] " EXTERNAL Gladis Olaf (Praktikant; CR/AEM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5aafeec0801100228x3092127bx97bddddc7a5a1fa0@mail.gmail.com \
--to=thekyz@gmail.com \
--cc=ecos-discuss@ecos.sourceware.org \
--cc=external.Olaf.Gladis@de.bosch.com \
--cc=pderocco@ix.netcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).