Hi Freddie,

I think this is another step in the right direction.  I've merged it.

> I've come with a problem, that has two solutions. When a board (or whatever)
> configures some event handlers (like "reset init") this is usually done like
> this:
>
>> $_TARGETNAME configure -event reset-init {
>>        ...
>> }
>
> But now, _TARGETNAME is defined deep within init procedures and is
> unavailable at this level. Solution 1 is to make _TARGETNAME global (inside
> setup_lpc2xxx and before use). Solution 2 is to use "real names" instead of
> variables ("lpc2103.cpu" instead of "$_TARGETNAME"). Which would be
> prefered?

This is a general problem of procedural programming. How
do you push information into some deep dark fn without
resorting to global variables?

How about passing the reset-init sequence(or part of it) as an
argument?

# this proc takes an initsequence as an argument
proc someproc {initsequence} {
}

someproc {
mww xxx
wmw yyy
}

> The same would be true for names like $_FLASHNAME and so on.

Rather than exporting the target & flash name, push the
information down into the proc's that need it.


-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to