Name

irq_setcb — sets the IRQ handler

Synopsis

#include <irq.h>   
irq_setcb (irq,  
 func); 
irq;
func;
 

Arguments

irq

irq for which the handler is to be registered

func

handler function to be invoked

Description

Specify the callback function to be invoked, when the interrupt occurs on the specified interrupt request (IRQ) line. The provided callback function address is inserted into the Interrupt Vector Table.

The callback does not take arguments and does not return values. An example callback is shown below.

Example


   void uart_irq_handler(void)
   {
   ...
   ...
   }
   ...
   irq_setcb(IRQ_UART, uart_irq_handler);

Availability

The function is not available while building programs for 8051 microcontrollers, using SDCC.