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

Close

#1399 interrupt vector not generated

closed-works-for-me
nobody
5
2013-05-25
2007-11-25
Anonymous
No

An ISR must be defined in the file that has the main() function or the vector table doesn't get an entry for it.

This was really annoying until I tried the following workaround.

Workaround:
put "extern void myisrfn(void) interrupt 42;" in a header file included by the main C file.

===
aheilveil@austin.rr.com

Discussion

  • Maarten Brock
    Maarten Brock
    2007-11-25

    • milestone: --> non_bugs
    • status: open --> closed-works-for-me
     
  • Maarten Brock
    Maarten Brock
    2007-11-25

    Logged In: YES
    user_id=888171
    Originator: NO

    This is no bug. This is documented behaviour.

     
  • Logged In: NO

    regression test case:
    using files included below
    c:\SDCC\BIN\SDCC.EXE -c --debug --use-stdout -V main.c
    c:\SDCC\BIN\SDCC.EXE -c --debug --use-stdout -V other.c

    after compilation inspect main.asm to see missing vector entry at __interrupt_vect
    === main.c
    #include "c8051f340.h"

    extern void notignoredisr(void) interrupt 3 ;

    void isrone(void) interrupt 1{

    }

    void main(){
    while(1){
    EA=1;
    }
    }
    === end main.c
    === other.c
    void ignoredisr(void) interrupt 2 {

    }

    void notignoredisr(void) interrupt 3 {

    }
    === end other.c
    aheilveil@austin.rr.com

     
  • Maarten Brock
    Maarten Brock
    2007-11-26

    Logged In: YES
    user_id=888171
    Originator: NO

    No need to prove this behaviour. It is known and documented in sdccman 3.8 Interrupt Service Routines / 3.8.1 General Information: "If you have multiple source files in your project, interrupt service routines can be present in any of them, but a prototype of the isr MUST be present or included in the file that contains the function main."