From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4049 invoked by alias); 28 Mar 2013 17:10:55 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 4014 invoked by uid 89); 28 Mar 2013 17:10:47 -0000 X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_VP autolearn=ham version=3.3.1 Received: from tetra.codeconfidence.com (HELO tetra.codeconfidence.com) (94.229.66.225) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 28 Mar 2013 17:10:43 +0000 Received: from cog.dallaway.org.uk (cpc1-cmbg10-0-0-cust34.5-4.cable.virginmedia.com [81.102.132.35]) by tetra.codeconfidence.com (Postfix) with ESMTP id 6ED01234C0A2; Thu, 28 Mar 2013 17:10:41 +0000 (GMT) Received: from cog.dallaway.org.uk (cog.dallaway.org.uk [127.0.0.1]) by cog.dallaway.org.uk (8.13.8/8.13.8) with ESMTP id r2SHAeni023014; Thu, 28 Mar 2013 17:10:41 GMT Message-ID: <51547990.4090309@dallaway.org.uk> Date: Thu, 28 Mar 2013 17:10:00 -0000 From: John Dallaway User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20121120 Thunderbird/10.0.11 MIME-Version: 1.0 To: Richard Rauch CC: eCos Discussion References: <000301ce2bd1$d0acd530$72067f90$@itrgmbh.de> In-Reply-To: <000301ce2bd1$d0acd530$72067f90$@itrgmbh.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [ECOS] Re: CDL/TCL issue building macro names in loops X-SW-Source: 2013-03/txt/msg00067.txt.bz2 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