avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] External EEPROM verses internal EEPROM data handling


From: Daniel O'Connor
Subject: Re: [avr-gcc-list] External EEPROM verses internal EEPROM data handling
Date: Mon, 4 May 2009 23:42:06 +0930
User-agent: KMail/1.9.10

On Mon, 4 May 2009, David Kelly wrote:
> On Mon, May 04, 2009 at 10:21:50PM +0930, Daniel O'Connor wrote:
> > On Mon, 4 May 2009, Bob Paddock wrote:
> > > > ? ? ? ? ? ? ? ?uint16_t voltage[24]; ? // adc counts of 24
> > > > channels in an array } ED; ? ? ? ? ? // total data = 58 bytes
> > >
> > > Because of issues of structure packing it is better to define
> > > structure items from the largest to the smallest, ie. uint16_t
> > > should be first.  This is more important on 32bit processors and
> > > up than on the 8bit AVRs.
>
> I suspect this is a homework assignment and the structure was
> provided.

Ah hmm..
The typedef names are fairly poor practise then.

> If I was defining the ED structure then I'd store 4 bytes of seconds
> since some epoch rather than 6 bytes of year, month, day, hour,
> minute, second. Much simpler, and routines to convert from seconds
> are readily available in OS's and spreadsheets.

It's OK so long as you don't have to deal with leap seconds :(
(ie dictate that it is in UTC, and make the recipient of your data do 
the work)

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]