isr.c

来自「一个实例接受」· C语言 代码 · 共 48 行

C
48
字号
/****************************************************************************
* Copyright (c) 2002 Windond Electronics Corp.
* All rights reserved.
*
* FILE NAME: isr.c
*
* DESCRIPTION: Interrupt functions of MAC Diagnostic Program for W90N740.
*
* AUTHOR: Jen-Hao Tsai, PC30
****************************************************************************/
//#include <stdio.h>
#include "board.h"
#include "uHAL\h\uhal.h"

// Interrupt Handler Table
typedef	void (*fptr)();	 // function pointer
fptr IRQ_HandlerTable[19];


// Setup Interrupt Handler Vector Table
void SysSetInterrupt(REG32 vector, void (*handler)())
{
 IRQ_HandlerTable[vector] = handler;
}


// Interrupt Service Routine	
void IRQ_IntHandler(int	x)
{
 unsigned int IPER, ISNR;

 IPER =	AIC_IPER >> 2;
 ISNR =	AIC_ISNR;

// uHALr_printf("ISNR=%d\n", ISNR);
 if ((ISNR<=16)&&(ISNR>=13))   //MAC Interrupts
   {
    if (ISNR == IPER)
      (*IRQ_HandlerTable[ISNR])();
   }   

#ifdef USE_TIME
 if (ISNR == 7 || ISNR == 8)
      (*IRQ_HandlerTable[ISNR])(); 
#endif

 AIC_EOSCR = 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?