Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

forward declaration of interrupts?

2007-03-15
2013-03-12
  • Matthias Arndt
    Matthias Arndt
    2007-03-15

    Hello,

    I have a small project with two source files, one of them implementing interruptdriven serial I/O for 8051.
    However I cannot get SDCC to link my files. I have added a prototype of the interrupt to the main.c containing main() as said in the manual. I still get the following linker error:

    $ sdcc --code-loc 0x100 main.rel sio.rel

    ?ASlink-Warning-Undefined Global '_com_isr' referenced by module 'main'

    My main.c has the following declaration:
    extern static void com_isr (void) interrupt 4;

    While the ISR itself is defined as follows in the sio.c file:
    static void com_isr (void) interrupt 4
    {
    ...

    The files themselves do compile and the assembler output looks sane.

    Is there a special trick to this?

    thanks,
    Matthias Arndt

     
    • try without 'static'

       
    • Matthias Arndt
      Matthias Arndt
      2007-03-15

      Thanks alot, that did help!