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