This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: I2C Bus definition problem
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 <andrew@lunn.ch> 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