On Monday 25 May 2009, David Brownell wrote:
> Make it so the magic "reset_config" keywords can be provided in any
> order. Example, "trst_and_srst" after "srst_open_drain", omitting
> the "separate" combination (which should be the default in any case).
>
> Why? (a) Makes it easier to define things at the right
> level (adapter, board, target). You can just specify the
> thing you *know* instead of having to somehow "know"
> extraneous things, just so you can provide a long enough
> keyword list. (b) Removing needless error paths is always
> good; such sequencing shouldn't matter.
>
> This includes two behavioral changes:
>
> (1) When "handle_reset_config" sees a parameter error, it
> immediately exits without changing anything. This is
> best viewed as a bugfix. (Old behavior: restore all
> the defaults, even if they weren't previously active.)
>
> (2) Only the behaviors that were explicitly specified get
> changed. (Old behavior: everything else gets reset to
> the "default".) So for example you can specify SRST
> drive requuirements without saying anything about the
> three unrelated topics you previously had to specify,
> and thus with no risk of providing incorrect values.
>
> That second one might cause confusion for any configs that end
> up calling "reset_config" twice, so it will deserve to be called
> out in the release notes.
>
> Update docs accordingly. Note that at least some versions of
> the texi-to-html tools can't handle "@xref{with spaces}", but
> those work properly in PDF and in the info files.
> ---
> doc/openocd.texi | 62 +++++++++++++++++------
> src/jtag/jtag.c | 140 ++++++++++++++++++++++++++++++++---------------------
> 2 files changed, 134 insertions(+), 68 deletions(-)
>
>
> ... this is "PROPOSAL 1" implemented. Didn't yet sanity test.
Works right if the loop is changed. FWIW this is a strike
against *non-use* of the standard argc/argv naming convention,
since entire reason for not writing it right the first time
was the need to think about it.
--- openocd.orig/src/jtag/jtag.c 2009-05-26 10:41:59.000000000 -0700
+++ openocd/src/jtag/jtag.c 2009-05-26 00:34:17.000000000 -0700
@@ -2664,7 +2664,7 @@ static int handle_reset_config_command(s
* Here we don't care about the order, and only change values
* which have been explicitly specified.
*/
- for (; argc; argc++) {
+ for (; argc; argc--, args++) {
int tmp = 0;
int m;
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development