interrupt.c
来自「ucos2400移植的源码。从网上下载供大家分享。」· C语言 代码 · 共 64 行
C
64 行
//================================================================================
//
// INTERRUPT.C - S3C2400 Interrupt Functions
//
// (C) Copyright 2003-3-19, ARM STUDY GROUP (Yoon Gwang-Yoon)
//
//================================================================================
/*------------------------------------------------------------------------------*/
/* INCLUDE LIST */
/*------------------------------------------------------------------------------*/
#include "REG_DEFINE.H"
#include "common.H"
/*------------------------------------------------------------------------------*/
/* ASSEM FUNCTION DEFINE LIST */
/*------------------------------------------------------------------------------*/
extern void enable_irq(void);
extern void disable_irq(void);
/*------------------------------------------------------------------------------*/
/* DEFINE LIST */
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/* VARIABLE LIST */
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/* Function LIST */
/*------------------------------------------------------------------------------*/
void IRQInit(void);
void IRQEnable(dword IRQBit);
void IRQDisable(dword IRQBit);
/*------------------------------------------------------------------------------*/
/* INTERRUPT 檬扁拳 FUNCTION */
/*------------------------------------------------------------------------------*/
void IRQInit(void)
{
disable_irq(); //-- Assembler ARM IRQ Disable
IRQDisable(BIT_ALLMSK); //-- All IRQ Mask
rINTMOD = 0x00000001; //-- EINT0 FIQ MODE SET
enable_irq(); //-- Assembler ARM IRQ Enable
}
/*------------------------------------------------------------------------------*/
/* IRQ Interrupt Enable FUNCTION */
/*------------------------------------------------------------------------------*/
void IRQEnable(dword IRQBit)
{
ClearPending(IRQBit); //clear pending bit
rINTMSK &= ~(IRQBit);
}
/*------------------------------------------------------------------------------*/
/* IRQ Interrupt Enable FUNCTION */
/*------------------------------------------------------------------------------*/
void IRQDisable(dword IRQBit)
{
rINTMSK |= (IRQBit);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?