NestedInterrupts

所属分类:其他嵌入式/单片机内容
开发工具:C/C++
文件大小:43KB
下载次数:69
上传日期:2006-04-17 19:34:09
上 传 者lizhbo
说明:  Freescale HCS12 系列嵌套中断源码
(Freescale HCS12 series nested interrupt source)

文件列表:
NestedInterrupts\bin (0, 2004-02-10)
NestedInterrupts\NestedInterrupts.mcp (119322, 2004-01-19)
NestedInterrupts\prms\_MC9S12DP256_FLAT.prm (8881, 2004-01-13)
NestedInterrupts\prms (0, 2003-11-04)
NestedInterrupts\project.ini (3463, 2004-01-13)
NestedInterrupts\sources\basic.c (9800, 2004-01-13)
NestedInterrupts\sources\basic.h (4393, 2003-10-01)
NestedInterrupts\sources\nested_ints.c (40543, 2003-10-01)
NestedInterrupts\sources\nested_ints.h (690649, 2003-10-01)
NestedInterrupts\sources\nested_ints_defs.h (5604, 2004-01-12)
NestedInterrupts\sources\peripherals.c (5857, 2003-09-29)
NestedInterrupts\sources\peripherals.h (5681, 2003-10-01)
NestedInterrupts\sources\target.h (4118, 2004-01-13)
NestedInterrupts\sources (0, 2003-11-04)
NestedInterrupts (0, 2006-04-17)

DESCRIPTION & USAGE INSTRUCTIONS -------------------------------- The files of the library are relatively large, but the majority of them are optimized out by the C preprocessor. The resulting code is highly optimized. The library consists of 3 files: 1. nested_ints.c - DO NOT MODIFY This file contains: I) A global variable (char current_interrupt_level) which is used to store the current interrupt level (the current interrupt level also needs to be backed-up locally in each interrupt service routine, the framework for performing this is provided - see below). II) A function for restoring the previous interrupt level at the end of every interrupt service routine (int_level_restore). This function returns void and requires one char argument. This argument needs to contain the interrupt level backed-up locally in the interrupt service routine (as mentioned above). 2. nested_ints.h - DO NOT MODIFY This file contains macros INT??_LEVEL_SET which disables all interrupt sources on the same and lower interrupt levels, stores the current interrupt level to a local variable (passed to the macro as the first and only argument), assigns a new value to the global interrupt level and re-enables interrupts. 3. nested_ints_defs.h This is the only file that may be modified by the user. It contains the following definitions (to be provided by the user): I) Interrupt enabling and disabling macros/functions at hardware level (if not provided somewhere else in user's software). II) Macro for enabling interrupts named ENABLE_INTERRUPTS(). III) Definitions of individual interrupts, their levels and associated enable/disable macros/functions. The definitions have the following format: #define INTn_m en_mac_or_fun,dis_mac_or_fun n - the interrupt number (the number is for enumeration purposes only, but for clarity it is advisable to keep it the same as the hardware interrupt number), this number needs to be unique. m - the interrupt level in the range from 1 to 63. The higher the number, the higher the interrupt priority level. Level 0 is reserved for the main task. en_mac_or_fun - name of macro or function used to enable the respective interrupt source at hardware level. dis_mac_or_fun - name of macro or function used to disable the respective interrupt source at hardware level. USAGE IN AN INTERRUPT SERVICE ROUTINE (replace ?? with actual interrupt number as defined in nested_ints_defs.h): void ISR(void) { static tU08 previousPriority; /* local variable to store priority level to allow return */ INT??_LEVEL_SET(previousPriority); /* store current priority level before changing it */ ...body of the interrupt service routine... int_level_restore(previousPriority); /* returns priority level to original level */ } LIMITED USE LICENSE AGREEMENT ----------------------------- PLEASE READ THIS AGREEMENT CAREFULLY BEFORE CONTINUING AND USING THIS SOFTWARE. BY USING THE SOFTWARE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. The software in either source code form ("Source")or object code form ("Object") (cumulatively hereinafter "Software") is provided under a license agreement ("Agreement") as described herein. By using the Software the person or persons performing the act of using the Software agree(s) to accept the terms of this Agreement, of if employed, the employer thereof agrees hereto (Licensee"). If the person using this software is employed, that person warrants that he has the authority of his employer to enter this license agreement. If Licensee does not agree with and accept the terms of this Agreement, Licensee must return or destroy any media containing the Software or materials related thereto, and destroy all copies of the Software. The Software is licensed to Licensee by Motorola Incorporated ("Motorola") for use under the terms of this Agreement. Motorola retains ownership of the Software. Motorola grants only the rights specifically granted in this Agreement and grants no other rights. Title to the Software, all copies thereof and all rights therein, including all rights in any intellectual property including patents, copyrights, and trade secrets applicable thereto, shall remain vested in Motorola. For the Source, Motorola grants Licensee a personal, non-exclusive, non-assignable, revocable, royalty-free right to use, copy, and make derivatives of the Source solely in a development system environment in order to produce object code solely for operating on a Motorola semiconductor device having a central processing unit ("Derivative Object"). For the Object and Derivative Object, Motorola grants Licensee a personal, non-exclusive, non-assignable, revocable, royalty-free right to copy, use, and distribute the Object and the Derivative Object solely for operating on a Motorola semiconductor device having a central processing unit. Licensee agrees to: (a) not use, modify, or copy the Software except as expressly provided herein, (b) not distribute, disclose, transfer, sell, assign, rent, lease, or otherwise make available the Software, any derivatives thereof, or this license to a third party except as expressly provided herein, (c) not remove obliterate, or otherwise defeat any copyright, trademark, patent or proprietary notices, related to the Software (d) not in any form export, re-export, resell, ship or divert or cause to be exported, re-exported, resold, shipped, or diverted, directly or indirectly, the Software or a direct product thereof to any country which the United States government or any agency thereof at the time of export or re-export requires an export license or other government approval without first obtaining such license or approval. THE SOFTWARE IS PROVIDED ON AN "AS IS" BASIS AND WITHOUT WARRANTY OF ANY KIND INCLUDING (WITHOUT LIMITATION) ANY WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MOTOROLA BE LIABLE FOR ANY LIABILITY OR DAMAGES OF ANY KIND INCLUDING, WITHOUT LIMITATION, DIRECT OR INDIRECT OR INCIDENTAL OR CONSEQUENTIAL OR PUNITIVE DAMAGES OR LOST PROFITS OR LOSS OF USE ARISING FROM USE OF THE SOFTWARE OR THE PRODUCT REGARDLESS OF THE FORM OF ACTION OR THEORY OF LIABILITY (INCLUDING WITHOUT LIMITATION, ACTION IN CONTRACT, NEGLIGENCE, OR PRODUCT LIABILITY) EVEN IF MOTOROLA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS DISCLAIMER OF WARRANTY EXTENDS TO LICENSEE OR USERS OF PRODUCTS AND IS IN LIEU OF ALL WARRANTIES WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR PARTICULAR PURPOSE. Motorola does not represent or warrant that the Software is free of infringement of any third party patents, copyrights, trade secrets, or other intellectual property rights or that Motorola has the right to grant the licenses contained herein. Motorola does not represent or warrant that the Software is free of defect, or that it meets any particular requirements or need of the Licensee, or that it conforms to any documentation, or that it meets any standards. Motorola shall not be responsible to maintain the Software, provide upgrades to the Software, or provide any field service of the Software. Motorola reserves the right to make changes to the Software without further notice to Licensee. Motorola does not guarantee compatibility of the Software with other applications, libraries or software packages of any kind. The Software is not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support of sustain life, or for any other application in which the failure of the Software could create a situation where personal injury or death may occur. Should Licensee purchase or use the Software for any such unintended or unauthorized application, Licensee shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the Software. The term of this Agreement is for as long as Licensee uses the Software for its intended purpose and is not in default of any provisions of this Agreement. Motorola may terminate this Agreement if Licensee is in default of any of the terms and conditions of this Agreement. This Agreement shall be governed by and construed in accordance with the laws of the State of Arizona and can only be modified in a writing signed by both parties. Licensee agrees to jurisdiction and venue in the State of Arizona. By using the Software, Licensee acknowledges that this Agreement has been read and understood and agrees to be bound by its terms and conditions. Licensee agrees that this Agreement is the complete and exclusive statement of the agreement between Licensee and Motorola and supersedes any earlier proposal or prior arrangement, whether oral or written, and any other communications relative to the subject matter of this Agreement. If you do not accept the terms and conditions of this Agreement, do not use the Software, and return the Software to Motorola.

近期下载者

相关文件


收藏者