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

📄 irq.h

📁 TDK 6521 SOC 芯片 DEMO程序
💻 H
字号:
/***************************************************************************
 * This code and information is provided "as is" without warranty of any   *
 * kind, either expressed or implied, including but not limited to the     *
 * implied warranties of merchantability and/or fitness for a particular   *
 * purpose.                                                                *
 *                                                                         *
 * Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved.    *
 ***************************************************************************/
//**************************************************************************
//  DESCRIPTION: 71M652x POWER METER - implement a dual-priority monitor.
//  This implements two priorities: preemptible, and non-preemptible.
//  Since there's only two, priority inversion is impossible.
//  Since the code runs to completion, hangs are impossible
//  Since there's only one locking flag, and thus one order
//  to get it, deadlocks are impossible.
//  Therefore, it's the guts of a very reliable exokernel.
//  Critical regions have to be kept brief, though! 100 microseconds
//  is a recommended maximum.
//  
//  We use this scheme instead of the more typical scheme that
//  just disables a single device's interrupt, because the single
//  device scheme can cause priority inversion.  E.g. a serial
//  interrupt may be disabled in the main loop.  Another device's (a timer...)
//  interrupt preempts the CPU because its interrupt is not locked.
//  The preempting interrupt may be lower priority... and cause
//  the serial interrupt to be delayed so much that data is lost.
// 
//  AUTHOR:  RGV
//
//  HISTORY: See end of file.
//**************************************************************************
//  File: irq.h
//
//  Disable interrupts; nestable and reentrant
void irq_disable (void) small reentrant;
//  Enable interrupts; nestable and reentrant
void irq_enable (void) small reentrant;
//  Sets up for the above; should be called early in initialization.
void irq_init (void);

// Use less time, more space, an incompatible scheme
#define IRQ_DEFINES  uint8_t ea = EA
#define IRQ_DISABLE() EA = FALSE
#define IRQ_ENABLE() EA = ea

/***************************************************************************
 * $Log: irq.h,v $
 * Revision 1.3  2006/09/09 01:15:21  gmikef
 * *** empty log message ***
 *
 * Revision 1.1  2005/10/08 04:41:32  tvander
 * Fixed priority inversion.
 * Rewrote watchdog to work in brownout, but of course it doesn't work.
 * Watchdog can now be defeated by clearing watchdog option to 0.
 * Reorganized watt hour modules (at last!).
 * Disabled reading of STATUS in 6521_cli because the CE's status is always SAG.
 * Tested with 6521_CLI; measurements seem to work.
 * Fixed other builds.
 *
 *
 * Copyright (C) 2005 Teridian Semiconductor Corp. All Rights Reserved.    *
 * this program is fully protected by the United States copyright          *
 * laws and is the property of Teridian Semiconductor Corporation.         *
 ***************************************************************************/

⌨️ 快捷键说明

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