I faithfully typed in all the I2C code from philips application notes, AN10155. I get the following when I compile in Keil:
Build target 'Target 1' assembling START900.A51... compiling demo.c... I2CEXPRT.H(65): error C141: syntax error near 'using' I2CEXPRT.H(65): error C141: syntax error near '1' DEMO.C(12): error C129: missing ';' before 'char' compiling I2CINTF.c... I2CEXPRT.H(65): error C141: syntax error near 'using' I2CEXPRT.H(65): error C141: syntax error near '1' I2CINTF.C(3): error C141: syntax error near 'char', expected ')' I2CINTF.C(5): error C129: missing ';' before 'char' compiling I2CDRIVR.C... I2CEXPRT.H(65): error C141: syntax error near 'using' I2CEXPRT.H(65): error C141: syntax error near '1' I2CDRIVR.C(19): error C141: syntax error near 'interrupt' I2CDRIVR.C(19): error C141: syntax error near '6' I2CDRIVR.C(19): error C141: syntax error near '1' I2CDRIVR.C(21): error C141: syntax error near 'STAT' I2CDRIVR.C(21): error C202: 'STAT': undefined identifier I2CDRIVR.C(23): error C172: 'case': missing enclosing switch I2CDRIVR.C(25): error C171: 'break': missing enclosing loop I2CDRIVR.C(26): error C172: 'case': missing enclosing switch I2CDRIVR.C(27): error C172: 'case': missing enclosing switch I2CDRIVR.C(30): error C171: 'break': missing enclosing loop I2CDRIVR.C(31): error C172: 'case': missing enclosing switch I2CDRIVR.C(32): error C172: 'case': missing enclosing switch Target not created
Exactly what settings must keil uVision be in in order to compile philips application notes code for AN10155?
Is this possibly just a syntax problem?
"but I don't understand why it isn't able to compile as it is still C code."
Some of the code is not standard C - The using and interrupt are extensions to the language specifications and can vary between compiler vendors.
A strict ANSI compilant compiler would throw out an error if you used these extensions.
After I had compiled it, I realized that different extensions were being used...I just was unsure how to translate them.
Thanks again for your help...I should be able to get this to compile soon. I'll post a link to the finished project when I'm done. I'm going to bed now...peace out.