On 17/12/2010, at 4:11 PM, Øyvind Harboe wrote:

> On Fri, Dec 17, 2010 at 7:06 AM, Peter Stuge <pe...@stuge.se> wrote:
>> Øyvind Harboe wrote:
>>> Which is better? (whatever "better" is)
>>> 
>>> This:
>>> 
>>> if {[info exists CHIPNAME]} {
>>>    set  _CHIPNAME $CHIPNAME
>>> } else {
>>>    set  _CHIPNAME at91r40008
>>> }
>> 
>> All these blocks in the target files have really annoyed me.
>> 
>> 
>>> or this:
>>> 
>>> set _CHIPNAME [defaultval $CHIPNAME at91r40008]
>> 
>> Significantly better.
> 
> It's trivial to do something shorter, like:
> 
> defaultval CHIPNAME at91r40008

Yes, definitely better.

> 
> The advantage of the more verbose syntax is that it
> is more self documenting:
> 
> set _CHIPNAME [defaultval $CHIPNAME at91r40008]

In this example, you would need this to be:

set _CHIPNAME [defaultval CHIPNAME at91r40008]

There are a lot of areas where the Tcl API could be improved in
openocd config files.
Your load_target is just another example of this.

> 
> Any preference?
> 
> -- 
> Øyvind Harboe
> 
> Can Zylin Consulting help on your project?
> 
> US toll free 1-866-980-3434 / International +47 51 63 25 00
> 
> 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

--
µWeb: Embedded Web Framework - http://uweb.workware.net.au/
WorkWare Systems Pty Ltd
W: www.workware.net.au      P: 0434 921 300
E: ste...@workware.net.au   F: 07 3102 9221




_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to