Page 1 of 1

Interrupt handler in component

Posted: Wed Aug 07, 2019 10:30 pm
by mnf
A bug in 8.2

I tried to create a component that uses an interrupt handler. Unfortunately the name mangling used doesn't seem to apply to the macro called in the enable interrupt icon.

A simple example:
bug.fcfx
(7.48 KiB) Downloaded 157 times
Which creates a simple component with an Init macro.
int_bug.fcpx
(1.03 KiB) Downloaded 166 times
A program that attempts to use this:
bug_demo.fcfx
(6.17 KiB) Downloaded 144 times
The C generated for the interrupt handler:

Code: Select all

void FCD_0ff51_int_bug1__interrupt_handler()
{
    //Local variable definitions
    MX_UINT8 FCL_N;

    // .n = 1
    FCL_N = 1;

}
& the interrupt setup using the wrong name is:

Code: Select all

    
    ISR(USART0_RX_vect)
    {
        FCM_interrupt_handler();
    }
Which gives compilation errors :-(

Is there a way around this - force FC to use a particular name etc ??

Martin

Re: Interrupt handler in component

Posted: Thu Aug 08, 2019 10:11 am
by Benj
Hi Martin,

Yes there is an event macro to allow you to add interrupt code inside a component. I'll send you a PM with an example.