📄 icu.c
字号:
/*----------------------------------------------------------------------------
* Copyright (c) 2001 by National Semiconductor Corporation
* National Semiconductor Corporation
*
* All rights reserved
*
*<<<-------------------------------------------------------------------------
* File Contents:
* icu.c - ICU related functions
*
* Project: USB Demo firmware
* Author : Yan Nosovitsky
* Date : Oct 2001
*----------------------------------------------------------------------->>>*/
#include "..\include\all.h"
/*----------------------------------------------------------------------------
* ICU_init()
*
* ICU initialization: mask all interrupts, install interrupt table
* The function MUST be called on the reset
*
*--------------------------------------------------------------------------*/
public void ICU_init(void)
{
_disable_();
/* Mask all interrupts */
IENAM0 = 0;
IENAM1 = 0;
/* Clear all pending interrupts */
IECLR0 = 0xffff;
IECLR1 = 0xffff;
_enable_();
}
/*----------------------------------------------------------------------------
* ICU_mask_int(int_no)
*
* Masks an interrupt
*
* Input:
* int_no Interrupt number
*
* Make very sure that the interrupts are disabled while masking
* the interrupt. Restore the int state as it was prior the
* call, and do not enable them blindly !!
*--------------------------------------------------------------------------*/
public void ICU_mask_int(int int_no)
{
_disable_();
ICU_MASK_INT(int_no);
_enable_();
}
/*----------------------------------------------------------------------------
* ICU_unmask_int(int_no)
*
* Unmasks an interrupt
*
* Input:
* int_no Interrupt number
*
* Make very sure that the interrupts are disabled while unmasking
* the interrupt. Restore the int state as it was prior the
* call, and do not enable them blindly !!
*--------------------------------------------------------------------------*/
public void ICU_unmask_int(int int_no)
{
_disable_();
ICU_UNMASK_INT(int_no);
_enable_();
}
/*----------------------------------------------------------------------------
* ICU_clear_int(int_no)
*
* Clears a pending interrupt
*
* Input:
* int_no Interrupt number
*
*--------------------------------------------------------------------------*/
public void ICU_clear_int(int int_no)
{
assert(0 <= int_no && int_no <= 31);
ICU_CLEAR_INT(int_no);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -