AN10369 I2C section

Hi

I am having issues with this I2C sample code they give in this application note! I have written it word for word and when i make it gives the following error:

In file included from main.c:10:

I2C.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘void’

it’s relating to the following line in my I2C.h

__irq void I2C_ISR();

it doesnt like the __ before the irq! how can i fix this?

what controller are you using?

Hi roach!

i’m using the lpc2148

ive changed my mind now and am just writing data out through the SDA line…i’m getting datd out but my target part which is the SAA1064 isn’t responding argh!

…but if you do know what my problem with the ISR was…then let me know! cos i’ll need to know for other applications!

Well it’s definitely a compile error. The compiler doesn’t like the __irq notation. Is this a macro defined somewhere? IF so, are you missing an #include? If not, are you using the same compiler recommended in the application note?

I’m just shooting in the dark here…

Hey roach!

i think u might b right…i’m just copying what was written in the app note! I havent defined the function anywhere…in my crt.S file this is defined…__irq: b . // IRQ

buti havent done any #include or extern thing

actually i’m not sure how to do those things!

seema:
actually i’m not sure how to do those things!

Don’t look at me, dude. I’ve done a bit of programming in my time (enough to recognize a compiler error), but I’m afraid the specifics are alittle over my head. Sorry…