From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21010 invoked by alias); 7 Sep 2007 13:07:12 -0000 Received: (qmail 20904 invoked by uid 22791); 7 Sep 2007 13:07:10 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Sep 2007 13:07:06 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1ITdY6-0006yu-00; Fri, 07 Sep 2007 15:07:02 +0200 Date: Fri, 07 Sep 2007 13:07:00 -0000 From: Andrew Lunn To: Alexandre Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20070907130702.GS32192@lunn.ch> Mail-Followup-To: Alexandre , ecos-discuss@ecos.sourceware.org References: <20070907125007.GR32192@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-IsSubscribed: yes 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 Subject: Re: [ECOS] I2C Bus definition problem X-SW-Source: 2007-09/txt/msg00036.txt.bz2 On Fri, Sep 07, 2007 at 02:53:50PM +0200, Alexandre wrote: > Ok it works ! > > Thank you, do you know what the error is about so ? > > On 9/7/07, Andrew Lunn wrote: > > Hi Alex > > > > Try this: > > > > static cyg_lpc2xxx_i2c_extra extra; > > > > CYG_I2C_BUS(i2cBusLpc, > > cyg_lpc2xxx_i2c_init, > > cyg_lpc2xxx_i2c_tx, > > cyg_lpc2xxx_i2c_rx, > > cyg_lpc2xxx_i2c_stop, > > ((void*)(&extra)) > > ); This declares a variable called i2cBusLpc. Since you have this inside a function, it is a local variable and so on the stack. However the macro tries to set attributes which can only be set on global variables. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss