Author Topic: Interrupt handler, GCC  (Read 7802 times)

Offline akorud

  • Newbie
  • *
  • Posts: 31
    • View Profile
Interrupt handler, GCC
« on: August 17, 2009, 04:07:00 PM »
Hi,
I'm setting interrupt handler using uTasker functionality:
Code: [Select]
INTERRUPT_SETUP interrupt_setup;
interrupt_setup.int_type     = PORT_INTERRUPT;   
interrupt_setup.int_priority = (INTERRUPT_LEVEL_3);
interrupt_setup.int_handler  = irq_handler;                           // handling function
interrupt_setup.int_port_bit = 3;                                    // The IRQ input connected
interrupt_setup.int_port_sense = IRQ_RISING_EDGE;                    // Interrupt on this edge
fnConfigureInterrupt((void *)&interrupt_setup);           
code is compilted with GCC. Do I need to add
Code: [Select]
__attribute__((interrupt_handler)) to my handler function?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: Interrupt handler, GCC
« Reply #1 on: August 17, 2009, 04:44:17 PM »
Hi

Your handling function is a call-back form the interrupts routine.
This means that it is a 'normal' routine and doesn't need to be declared as an interrupt. It also doesn't need to handle the interrupting peripheral since this is performed by the interrupt handler.

Regards

Mark