This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: CDL/TCL issue building macro names in loops
- From: John Dallaway <john at dallaway dot org dot uk>
- To: Richard Rauch <rrauch at itrgmbh dot de>
- Cc: eCos Discussion <ecos-discuss at sourceware dot org>
- Date: Thu, 28 Mar 2013 17:10:40 +0000
- Subject: Re: CDL/TCL issue building macro names in loops
- References: <000301ce2bd1$d0acd530$72067f90$ at itrgmbh dot de>
Hi Richard
On 28/03/13 16:32, Richard Rauch wrote:
> I have problems with creating macro name dynamically with TCL language.
>
> I have to implement an ADC driver. I want to create the list of channels.
> Because the large number of channels (10 internal channel with ACT value,
> MIN value and MAX value and 15 external channels) I want to create the
> channel list more convenient.
>
> The following code (some excerpt of my CDL script) works already good, but
> it is not matching my requirements completely:
>
> #---------------------------------------------------------------------------
> ----------------------------------------
> set SensorList { temp vccint vccaux vpvn vrefp vrefn vccbram vccpint vccpaux
> vcc0ddr } foreach Sensor $SensorList {
>
> cdl_component CYGNUM_DEVS_ADC_ARM_XC7Z_ONCHIP_$Sensor {
You may be able to adapt the approach used in the MCF52xx CAN driver CDL
script to work with your list of sensors:
> for { set ::flexcan 0 } { $::flexcan < 2 } { incr ::flexcan } {
> cdl_interface CYGINT_DEVS_CAN_MCF52xx_FLEXCAN[set ::flexcan] {
I hope this helps...
John Dallaway
eCos maintainer
http://www.dallaway.org.uk/john
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss