Interrupt with parameters

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Interrupt with parameters

1,047件の閲覧回数
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 件の賞賛
1 返信

1,036件の閲覧回数
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 件の賞賛