avrdude-dev
[Top][All Lists]
Advanced

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

Re: [avrdude-dev] [patch #7603] wiring - programmer type for Wiring boar


From: Joerg Wunsch
Subject: Re: [avrdude-dev] [patch #7603] wiring - programmer type for Wiring boards (based on STK500v2)
Date: Thu, 25 Aug 2011 10:44:56 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

As Brett Hagman wrote:

> So where do you think I can store my parameter data?  I'm REALLY tempted to
> use a global :)

Please don't.  I've once turned all the globals into programmer
private data.  The idea behind that is that everything except main.c
should be able to go into a library, so (at least in theory) it's
possible to build a different frontend to it than the CLI main.c we've
got now.

Hopefully, instead of writing the umpteenth GUI wrapper for AVRDUDE,
someone will eventually step forward, and create a native GUI-based
frontend then.  I know the code needs more cleanup for that, like
removing all calls to exit() from library code, but re-introducing a
global variable would be the wrong direction.

> I realize that programmer type inheritance wasn't a top concept when
> this was built.

Exactly.

I'm doing something like that in the various interconnections between
the JTAG ICE mkII and the STK500v2 code, as basically all the Atmel
tools somehow implement both of them, but in different ways:

. the AVRISPmkII is like STK500v2, but USB only, and thus omits the
  RS-232 framing

. the JTAGICEmkII has an ISP mode that is like STK500v2, but
  encapsulated into JTAGICEmkII framed packets

. the STK600 is like the AVRISPmkII, except it also offers JTAG
  which is like unframed JTAGICEmkII

. the AVR Dragon is all of the above, more or less

:-/

What I'm doing is to keep two different sets of private data, which
are swapped when crossing the programmer domain between jtag2 and
stk500v2.  Alas, not all of the bugs around that have been sorted out
yet (see bug #33114), but basically, it works.

I wish there had been a better method, yes.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

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