[U-Boot-Users] [PATCH] Add flash programming counter]

Jerry Van Baren
2008-03-07T20:52:38Z

Wolfgang Denk wrote:
> In message <47D17784.80604@ge.com> you wrote:
>> OK, here is a simulation of what I will create tonight. I think this is
>> both workable, very effective, and meets Wolfgang's constraints.
>
> I like it.
>
>> > ./dots 99
>> Writing to Flash... 0....1....2....3....4....5....6....7....8....9.... Done
>>
>> > ./dots 1
>> Writing to Flash... 0 Done
>
> This is kind of misleading. I hear customers (or participants of our
> training classes) asking if "0 done" means that nothing was done.
>
> Can we just omit the 0?
>
> Best regards,
> Wolfgang Denk

To quote a quote I got from you:

Zero is an enigmatic value. It can mean success (fclose) or failure
(scanf). It can mean black or white. It can mean no permissions (chmod)
or all permissions (umask). It can mean now (setjmp) or later (atexit).
It can mean the beginning (lseek) or the end (read). It can mean myself
(getpgrp) or child (fork). It can mean all (kill's 1st argument) or
nothing (kill's 2nd argument). It can mean 'default' (SIG_IGN) or 'I
don't care' (waitpid) or 'try to guess' (strtol). Indeed 0 lets you talk
to God (setuid). Verily is 0 all things to all people.

-- an ancient usenet posting

My current thought is
* Start counting at 1
* Suppress the dots if there are fewer than the configured max
(rationale: if there are fewer units to program than dots, it will
be done very quickly anyway)
* Have a configurable upper limit, default to 45 (1..9). This will
allow changing the #define to make the dots friendlier to 40
column displays, for instance.

> ./dots 1
Writing to Flash... Done

> ./dots 44
Writing to Flash... Done

> ./dots 45
Writing to Flash... ....1....2....3....4....5....6....7....8....9 Done

> ./dots 4500000
Writing to Flash... ....1....2....3....4....5....6....7....8....9 Done

gvb