cassemblyintegrationpic24

MpLab C, Assembly, Interrupt defined conflicts


I am placing some new C software routines together with an existing arrangement of assembly language.

I am finding these errors

    multiple definition of `_U1RXInterrupt'
    multiple definition of `_U2RXInterrupt'
    multiple definition of `_U3RXInterrupt'

Where, when, how, do I get the C compiler to let me have the U1RXInterrupt for my assembly routines ? Ditto for U2RXInterrupt

Update, 2013-MAR-13

Just found this in the C code. Is this the source of my problems ? IF I take take this away, will my conflicts be over ?

   //********************U1RX interrupt********************************//
   void __attribute__ ((interrupt, no_auto_psv)) _U1RXInterrupt(void) 
   {
    IFS0bits.U1RXIF = 0;
    U1Buf_RX=U1RXREG;
    //putcharUART2(U1Buf_RX);
   }

I want my assembly language routines to handle Uart 1

I'm guessing that I will find a similar handler for U2RXInterrupt(void)


Solution

  • You can only define one subroutine for a given interrupt. Whatever an ISR is defined through C code or assembler, it must be unique in your application.

    So if you want to use your assembler ISR, you must either remove the other one from the C code or not link your application with the object or library that brings it.