Page 1 of 1

Timer interrupt in component code generation error

Posted: Thu Nov 20, 2014 12:05 am
by kersing
When using a timer (Timer1) in a component the code generation fails. The code for the macro is generated as expected:

Code: Select all

void FCD_06431_udpipstack1__TimerTick()
However the interrupt block generated calls the macro as if in the main flowchart:

Code: Select all

/*========================================================================*\
   Use :Interrupt
\*========================================================================*/

    //Handler code for [TMR1]
    #ifndef MX_ISR_T1
    #define MX_ISR_T1
    void _ISR _T1Interrupt(void)
    {
        IFS0bits.T1IF = 0;
        FCM_TimerTick();
    }
    #else
    #warning "This interrupt has previously been enabled, so the macro <TimerTick> may never get called."
    #endif

Re: Timer interrupt in component code generation error

Posted: Thu Nov 20, 2014 11:48 am
by Benj
Hi Jac,

Interrupts in components are a bit tricky to get right. I'll PM you a couple of examples of how I have done this in components that require interrupts.