From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28650 invoked by alias); 7 Sep 2007 10:23:27 -0000 Received: (qmail 28639 invoked by uid 22791); 7 Sep 2007 10:23:26 -0000 X-Spam-Check-By: sourceware.org Received: from wa-out-1112.google.com (HELO wa-out-1112.google.com) (209.85.146.181) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Sep 2007 10:23:22 +0000 Received: by wa-out-1112.google.com with SMTP id l24so553568waf for ; Fri, 07 Sep 2007 03:23:21 -0700 (PDT) Received: by 10.115.75.1 with SMTP id c1mr1515680wal.1189160597871; Fri, 07 Sep 2007 03:23:17 -0700 (PDT) Received: by 10.114.15.3 with HTTP; Fri, 7 Sep 2007 03:23:17 -0700 (PDT) Message-ID: Date: Fri, 07 Sep 2007 10:23:00 -0000 From: Alexandre Reply-To: thekyz@gmail.com To: ecos-discuss@ecos.sourceware.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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: [ECOS] I2C Bus definition problem X-SW-Source: 2007-09/txt/msg00030.txt.bz2 Hi everybody, I'm near the end in my attempt to make an I2C driver for the LPC2XXX platform. I'm trying to declare my i2c bus using the I2C generic macro CYG_I2C_BUS Currently the declaration looks like this: CYG_I2C_BUS(i2cBusLpc, cyg_lpc2xxx_i2c_init, cyg_lpc2xxx_i2c_tx, cyg_lpc2xxx_i2c_rx, cyg_lpc2xxx_i2c_stop, ((void*)(&extra)) ); 'extra' being declared two lines above like this: static cyg_lpc2xxx_i2c_extra extra; When I try to compile the code, the compiler says for the line where I use the macro: 'section attribute cannot be specified for local variables' I tried to look over the internet for hints on that error and found nothing but error logs with the same error and nothing to get rid of it. Does someone have an idea of what i'm doing wrong ? PS: For those of you unfamiliar with the ecos I2C interface, here is what the declaration of the I2C bus structure looks like: typedef struct cyg_i2c_bus { cyg_drv_mutex_t i2c_lock; #ifdef CYGDBG_USE_ASSERTS const cyg_i2c_device* i2c_current_device; #endif // The hardware-specific functions that do the real work void (*i2c_init_fn)(struct cyg_i2c_bus*); cyg_uint32 (*i2c_tx_fn)(const cyg_i2c_device*, cyg_bool, const cyg_uint8*, cyg_uint32, cyg_bool); cyg_uint32 (*i2c_rx_fn)(const cyg_i2c_device*, cyg_bool, cyg_uint8*, cyg_uint32, cyg_bool, cyg_bool); void (*i2c_stop_fn)(const cyg_i2c_device*); // A spare field for use by the driver void* i2c_extra; } CYG_HAL_TABLE_TYPE cyg_i2c_bus; And the declaration macro: #define CYG_I2C_BUS(_name_, _init_fn_, _tx_fn_, _rx_fn_, _stop_fn_, _extra_) \ cyg_i2c_bus _name_ CYG_HAL_TABLE_ENTRY( i2c_buses ) = { \ .i2c_init_fn = _init_fn_, \ .i2c_tx_fn = _tx_fn_, \ .i2c_rx_fn = _rx_fn_, \ .i2c_stop_fn = _stop_fn_, \ .i2c_extra = _extra_ \ } -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss