This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

philips AN10155

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?

Parents
  • I gave your project a quick try.

    There are some 'issues' with your code concerning interrupt and using, the format of the lines should be:

    void Isr(void) interrupt 1 using 2
    

    Note that the digits above are examples only.

    There is one function prototype in a header file like:

    extern interrupt(1) void isr(void);
    

    The inclusion of the 'interrupt(1)' is wrong and, as far as I am aware, is not relevant to a function prototype.

    There are a few instances of items like:

    rom char *xxx;
    

    The 'rom' is not a recognised C51 keyword - Maybe you have missed a define of it in your code.

    There are numerous 'silly' typographical errors, especially with regards underlines - Some you appear to have missed and some you have replaced with '-'.

    I would suggest that you go through the code, looking at each error from the first and correct each one in turn - You should soon then have code that at least compiles without problems.

    In answer to your question: Yes I think that all errors are simple syntax errors.

Reply
  • I gave your project a quick try.

    There are some 'issues' with your code concerning interrupt and using, the format of the lines should be:

    void Isr(void) interrupt 1 using 2
    

    Note that the digits above are examples only.

    There is one function prototype in a header file like:

    extern interrupt(1) void isr(void);
    

    The inclusion of the 'interrupt(1)' is wrong and, as far as I am aware, is not relevant to a function prototype.

    There are a few instances of items like:

    rom char *xxx;
    

    The 'rom' is not a recognised C51 keyword - Maybe you have missed a define of it in your code.

    There are numerous 'silly' typographical errors, especially with regards underlines - Some you appear to have missed and some you have replaced with '-'.

    I would suggest that you go through the code, looking at each error from the first and correct each one in turn - You should soon then have code that at least compiles without problems.

    In answer to your question: Yes I think that all errors are simple syntax errors.

Children