Interrupt request on STMF3

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
PhantomFav
Posts: 2
Joined: Wed May 28, 2014 9:58 am

Interrupt request on STMF3

Post by PhantomFav »

Hi, i need to pilot the following interrupt request by the user button on a STMF3

Code: Select all

CH_IRQ_HANDLER(myIRQ) {
  CH_IRQ_PROLOGUE();
 
  /* Wakes up the thread.*/
  chSysLockFromIsr();
  if (tp != NULL) {
    tp->p_u.rdymsg = (msg_t)55;     /* Sending the message, optional.*/
    chSchReadyI(tp);
    tp = NULL;
  }
  chSysUnlockFromIsr().
 
  CH_IRQ_EPILOGUE();
}


how can i do this?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Interrupt request on STMF3

Post by Giovanni »

Hi,

You don't need to use an ISR at all, you can use the EXT driver which can give you a callback on a front on any pin. See the examples under /testhal.

Giovanni
PhantomFav
Posts: 2
Joined: Wed May 28, 2014 9:58 am

Re: Interrupt request on STMF3

Post by PhantomFav »

Thank you Giovanni for your reply, it's all what i need.
Post Reply