+++ Øyvind Harboe [2009-10-10 09:18 +0200]:
> We have lots of these codelets around OpenOCD:
>
> if { [info exists CHIPNAME] } {
> set _CHIPNAME $CHIPNAME
> } else {
> set _CHIPNAME pxa270
> }
>
> Does anyone find this the syntax below simpler or just
> more obscure?
>
> -expected-id [defaultvalue CPUTAPID 0x12345678]
It is a bit obscure (looks like it is defining a default value, rather
than returning either the set value or the default value), but it's
also a lot more pleasing, and most of the time this distinction won't
matter. Explaining it in the docs somewhere should make it clear.
This syntax makes it rather easier to have more than one expected-id
too (althogh I still think a better solution there in the medium term
is to specify the components of the ID (vendor/device/stepping) and
allow don't-care bits.
Wookey
--
Principal hats: iEndian - Balloonboard - Toby Churchill - Emdebian
http://wookware.org/
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development