avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] chip_erase and cycle_count cleanup


From: Theodore A. Roth
Subject: Re: [avrdude-dev] chip_erase and cycle_count cleanup
Date: Mon, 1 Dec 2003 16:46:10 -0800 (PST)


On Tue, 2 Dec 2003, Jan-Hinnerk Reichert wrote:

> On Tuesday 02 December 2003 01:25, Theodore A. Roth wrote:
> > On Tue, 2 Dec 2003, Jan-Hinnerk Reichert wrote:
> > > On Monday 01 December 2003 23:27, Theodore A. Roth wrote:
>
> > > However, there is only one occurance of this magic number left in
> > > my version and this is in avr_get_cycle_count():
> > >
> > >   if (cycle_count == 0xffffffff) {
> > >     cycle_count = 0;
> > >   }
> >
> > Even if it's only used once, it still improves readability by
> > avoiding the magic number. 0xfffffffff doesn't infer the eeprom is
> > erased without a few extra brain cycles.
>
> No objections. Only open question is where to put the define. I would
> place it in "avr.c", since it is unuseable elsewhere. I would rather
> put it near the place where it is used, instead of the top of file.
>
> Is it considered bad style to do this?

Doesn't matter to me. I'd also add a comment as to the rationale of the
value behind the macro.

>
> > > BTW: Would you mind testing the patch on STK500 or PPI?
> >
> > Sure, but it may take a few days since I'm swamped with day job
> > and simulavr work right now.
>
> Take your time.
>
> BTW: The listserver is either terribly slow or it is eating mails :-(

The savannah hackers did a major overhaul of the savannah site over the
weekend. May or may not be related.

Aren't we about due for the next round Windows viruses to slow down the
internet again? Sorry, couldn't help myself (Bad Ted, no cookie).

Ted Roth




reply via email to

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