Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 Installing Shared Interrupt Handlers Interrupt Handler for RTKSetIRQHandler Preemptive or Cooperative Multitasking? Starting Objects' Methods as Tasks Performance and Interrupt Response Times Task Switches in Cooperative Scheduling Using the FPU in Interrupt Handlers |
Interrupt Handler for RTKSetIRQHandlerThis method of installing interrupt handler is deprecated. Please see section Installing Shared Interrupt Handlers for the recommended method. An interrupt handler to be installed with RTKSetIRQHandler should have the following structure:
Example:#define IRQ 3 void RTKAPI IntHandler(void) // high level interrupt handler in C { char Data; RTKEnableInterrupts(); // allow higher level interrupts RTIn(IOBASE+LSR); // clear line status errors Data = RTIn(IOBASE+RXB); // get the received byte RTKPutCond(Buffer, &Data); // and insert in mailbox RTKIRQEnd(IRQ); // done } ... int main(void) { ... RTKSetIRQHandler(IRQ, IntHandler); // install handler RTKEnableIRQ(IRQ); // enable IRQ // program device to start sending interrupts here ... RTKDisableIRQ(IRQ); // disable IRQ ... } Installing Shared Interrupt Handlers
|