Interrupt with parameters

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Interrupt with parameters

1,778 Views
slanfys
Contributor I

Hello 

I'm using codewarrior IDE for a MC9s08JM16 cpu.

I'm trying to use a interrupt with parameters. When I write the next interrupt in the MCUinit.c file:

 

__interrupt void isrVkeyboard(bool ON)
{
   ON = ~ON;
   if(ON) // Si está encendido el motor
   {
      LedVerde = 1;
   }else{ // Si está parado el motor
      LVerde = 0;
   }

KBISC_KBACK = 1;
}

 

I got an error point out that this error is pinpointed in the next function:

static void (* near const _vect[])(void) @0xFFC4 = { /* Interrupt vector table */
      isrVrtc, /* Int.no. 29 Vrtc (at FFC4) Used */
      UNASSIGNED_ISR, /* Int.no. 28 Viic (at FFC6) Unassigned */
->   isrVkeyboard, /* Int.no. 25 Vkeyboard (at FFCC) Used */

      ....

      _Startup

};

 

Any suggestion?

0 Kudos
Reply
1 Reply

1,767 Views
stanish
NXP Employee
NXP Employee

Hi,

Could you possibly describe what are you trying to achieve by passing the parameter to the interrupt handler?

Interrupt handler is called/executed asynchronously typically by a hardware event so IMAO there is no chance to pass any parameter to it.

Therefore interrupts are typically declared as void functions without partameters.

What about using global variable instead of parameter?

Hope it helps.

Stan

 

0 Kudos
Reply