avrdude-dev
[Top][All Lists]
Advanced

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

RE: [avrdude-dev] optional hash mark progress indicator


From: Alex Shepherd
Subject: RE: [avrdude-dev] optional hash mark progress indicator
Date: Sat, 26 Jul 2003 14:31:12 +1200

Hi Guys,

> > Thanks - I knew there was something else going on that
> wasn't obvious.
>
> Ah ... now I see why there is a bit of confusion here.  It is because
> 'verbose' is not being used consistantly.  The progress indicator
> within 'avr_write()' is used for parallel port type programmers, while
> there is also an identical one coded that the stk500 programmer code
> displays.  The one within the stk500.c page write routine is
> controlled by the global variable 'verbose', while the one inside
> 'avr_write()' is controlled by the local 'verbose' variable.  It's
> been so long since I've used a parallel port connected programmer,
> that I was unaware of this inconsistancy.

Well I too have been hacking away at this code inside avr.c and main.c

I added a -q option that turns off a global variable showProgress that
defaults to on

Then I changed the calls to avr_read/write to pass this new showProgress
option.

Then in avr.c I moved the progress code out to its own function
updateProgress( int offset, int size )

This function looks at another global hashProgress that if 1 shows a bar of
#'s or if false shows a numeric % complete. Both tick up at 5% intervals.

My output looks like this:

avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x1e9307
avrdude: erasing chip
avrdude: done.
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (6656 bytes):
avrdude: |0%               100%|
avrdude: |#####################|
avrdude: 6656 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: reading on-chip flash data:
avrdude: |0%               100%|
avrdude: |#####################|
avrdude: verifying ...
avrdude: 6656 bytes of flash verified
avrdude: done. elapsed time: 7 sec

First I write out the

avrdude: |0%               100%|
avrdude: |

Then as it progresses each hash is printed and then a "|\n" is added
          #####################|

to produce

avrdude: |0%               100%|
avrdude: |#####################|

Here is this version:

http://www.wave.co.nz/~ashepherd/Avrdude_26July.zip

Cheers

Alex





reply via email to

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