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

📄 int_handle.c

📁 f2812的初始化构架
💻 C
📖 第 1 页 / 共 3 页
字号:
/*                    INT  SVC system
* Copyright (c) 2006,南京因泰莱电器股份有限公司开发部
* All rights reserved.
* 
* 文件名称:interrupt.c
* 摘    要:实现F2812中断的各种处理函数,为以后的开发准备
* 
* 当前版本:0.9
* 作    者:洪远洋 
* 完成日期:2006年12月29日
*
* 取代版本:0.1
* 原作者  :洪远洋
* 完成日期:2006年12月28日
*/
/*********************************************************************/
#include "device.h"
#include "F2812reg.h"
/*********************************************************************/

interrupt void c_dummy1(void)
{
    int i=0;
	i++;
	PIEACK=0xffff; 
}
interrupt void c_dummy(void)
{
	int i=0;
	i++;
	PIEACK=0xffff; 
	asm("	CLRC INTM");               // 调试使能 
}

/*********************************************************************/
interrupt void TINT0_ISR(void)			// 0x000D4C  TINT0 (CPU TIMER 0)
{
    int i = 0;
// Work around Compiler v3.03 bug
//	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
//	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround
    i++;
    asm("	CLRC INTM");               // 调试使能 
    PIEACK=0xf00f;
   // PIEACK=0xffff; 
//	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;	// Must acknowledge the PIE group

// Next two lines for debug only - remove after inserting your ISR
//	asm (" ESTOP0");					// Emulator Halt instruction
//	while(1);
}

/*********************************************************************
interrupt void INT14_ISR(void)			// 0x000D1C  INT14 - CPU Timer2, reserved for TI
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

*********************************************************************/
interrupt void DATALOG_ISR(void)		// 0x000D1E  DATALOG - CPU data logging interrupt
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void RTOSINT_ISR(void)		// 0x000D20  RTOSINT - CPU RTOS interrupt
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void EMUINT_ISR(void) 		// 0x000D22  EMUINT - CPU emulation interrupt
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void NMI_ISR(void)			// 0x000D24  NMI - XNMI interrupt
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void ILLEGAL_ISR(void)		// 0x000D26  ILLEGAL - illegal operation trap
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER0_ISR(void)			// 0x000D28  USER0 - software interrupt #0
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER1_ISR(void)			// 0x000D2A  USER1 - software interrupt #1
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER2_ISR(void)			// 0x000D2C  USER2 - software interrupt #3
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER3_ISR(void)			// 0x000D2E  USER3 - software interrupt #3
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER4_ISR(void)			// 0x000D30  USER4 - software interrupt #4
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER5_ISR(void)			// 0x000D32  USER5 - software interrupt #5
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER6_ISR(void)			// 0x000D34  USER6 - software interrupt #6
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER7_ISR(void)			// 0x000D36  USER7 - software interrupt #7
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER8_ISR(void)			// 0x000D38  USER8 - software interrupt #8
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER9_ISR(void)			// 0x000D3A  USER9 - software interrupt #9
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER10_ISR(void)			// 0x000D3C  USER10 - software interrupt #10
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void USER11_ISR(void)			// 0x000D3E  USER11 - software interrupt #11
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround


// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void PDPINTA_ISR(void)		// 0x000D40  PDPINTA (EV-A)
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

//	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;	// Must acknowledge the PIE group

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void PDPINTB_ISR(void)		// 0x000D42  PDPINTB (EV-B)
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

//	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;	// Must acknowledge the PIE group

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

/*********************************************************************/
interrupt void XINT1_ISR(void)			// 0x000D46  XINT1
{   
    
       
     
     
}     

/*********************************************************************/
interrupt void XINT2_ISR(void)			// 0x000D48  XINT2
{
// Work around Compiler v3.03 bug
	asm(" SPM  0");						// Compiler not properly setting SPM 0 in ISRs
	asm(" CLRC AMODE");					// Compiler not properly setting AMODE=1 in ISRs
// End workaround

//	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;	// Must acknowledge the PIE group

// Next two lines for debug only - remove after inserting your ISR
	asm (" ESTOP0");					// Emulator Halt instruction
	while(1);
}

⌨️ 快捷键说明

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