⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intrhndl.c

📁 自己写的ARM移植代码
💻 C
字号:
/***********************************************************************/
/*                                                                     */
/*   MODULE:      bsps/KS32C50K/src/intrhndl.c                         */
/*   PURPOSE:     Exception initialisation code for ARM Arch.          */
/*   Description: KS32C5000 BSP ver.1.0.  99/03/01.  by Shin.          */
/*                                                                     */
/*---------------------------------------------------------------------*/
/*              COPYRIGHT 1999 SAMSUNG ELECTRONICS.                    */
/*                             INTEGRATED SYSTEMS, INC.                */
/*---------------------------------------------------------------------*/
/*                                                                     */
/*                                                                     */
/***********************************************************************/

#include "isr.h"
#include "stdtype.h"
#ifndef MAXHNDLRS
#define MAXHNDLRS       21
#endif

void (*InterruptHandlers[MAXHNDLRS])(void);

static void DummyIsr() { }

/***********************************************************************/
/* InitIntHandlerTable: Initialize the interrupt handler table         */
/*                                                                     */
/*     NOTE(S): This should be called during system initialization     */
/*              by HdwInit.                                            */
/*                                                                     */
/***********************************************************************/
void InitIntHandlerTable(void)
{
    int i;


    // Initialize interrupt handler table to dummy function.
    for (i = 0; i < MAXHNDLRS; i++)
        InterruptHandlers[i] = DummyIsr;
}


/***********************************************************************/
/* SysSetInterrupt: Set the interrupt handler.                         */
/***********************************************************************/
void SysSetInterrupt(unsigned long vector, void (*handler)())
{
    // Initialize each interrupt handler to user defined function.
    InterruptHandlers[vector] = handler;
}


/***********************************************************************/
/* MainIntHandler: main interrupt handler                              */
/*                                                                     */
/*      INPUTS: vector: vector offset of interrupt                     */
/*       NOTES: The pSOS+ kernel calls this routine to handle all      */
/*              interrupts.                                            */
/*                                                                     */
/***********************************************************************/

void MainIntHandler(int offset)
{
	int	DumyOp;
    // Clear pending bit in the INTPEND register.
    Clear_PendingBit(offset>>2) ;

    if(*InterruptHandlers[offset>>2] != DummyIsr)
	{
	    if((offset>>2) ==12)//48
		{
			DumyOp=1;
		}
	    if((offset>>2) ==13)//52
		{
			DumyOp=2;
		}
	    if(! ((offset>>2) == 10 || (offset>>2) == 17) || (offset>>2) == 18)//52
		{
			DumyOp=3;
		}

		// Call interrupt service routine.
		(*InterruptHandlers[offset>>2])(); 
	}
	else
	{
		DumyOp=4;
	}
}

void	ISR_AbortHandler(REG32 *adr)
{

}

⌨️ 快捷键说明

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