Interrupt handler in component

Moderator: Benj

mnf
Valued Contributor
Valued Contributor
Posts: 514
Joined: Wed May 31, 2017 11:57 am
Has thanked: 52 times
Been thanked: 285 times
Contact:

Interrupt handler in component

Postby mnf » Wed Aug 07, 2019 10:30 pm

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 13 times

Which creates a simple component with an Init macro.
int_bug.fcpx
(1.03 KiB) Downloaded 8 times

A program that attempts to use this:
bug_demo.fcfx
(6.17 KiB) Downloaded 7 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: 14238
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4366 times
Been thanked: 4103 times
Contact:

Re: Interrupt handler in component

Postby Benj » Thu Aug 08, 2019 10:11 am

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.