Interrupt handler in component

Moderator: Benj

Post Reply
mnf
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Interrupt handler in component

Post 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 160 times
Which creates a simple component with an Init macro.
int_bug.fcpx
(1.03 KiB) Downloaded 168 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Interrupt handler in component

Post 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.

Post Reply