📄 csl_intcclose.c
字号:
/* ============================================================================ * Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005 * * Use of this software is controlled by the terms and conditions found in the * license agreement under which this software has been supplied. * =========================================================================== *//** @file csl_intcClose.c * * @brief File for functional layer of CSL API @a CSL_intcClose() * * Description * - @a CSL_intcClose() function definition * * Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src\\intc * * Modification * - Modified on: 2004/06/07 (Francis S) * - Reason: Added critical section protection. * : Added Interrupt Priority mask * * - Modified on: 2004/04/15 * - Reason: creation * * Date 2004/04/15 * Author RG Kiran * */#include <csl_intc.h>#include <csl_error.h>#include <csl_types.h>#include <csl_sysData.h>/** ============================================================================= * @n@b CSL_intcClose * * @b Description * @n Releases an allocated event. CSL_intcClose () must be called to * release an event that has been previously allocated with a call * to CSL_intcOpen (). * * @b Arguments * @verbatim hIntc Handle identifying the event @endverbatim * * <b> Return Value </b> CSL_Status * @li CSL_SOK - Close successful * @li CSL_ESYS_FAIL - Close failed * * @b Example * @verbatim CSL_IntcHandle hIntc; CSL_status status; ... status = CSL_intcClose(hIntc); if (status != CSL_SOK) { // close failed! // } @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_intcClose, ".text:csl_section:intc");CSL_Status CSL_intcClose ( CSL_IntcHandle hIntc){ CSL_Status closeStatus = CSL_ESYS_BADHANDLE; if (hIntc != CSL_INTC_BADHANDLE) { register int evt = hIntc->eventId; if ((evt != CSL_INTC_EVENTID_INVALID) && (evt >= _CSL_INTC_EVENTID__INTC1START)) { int n = evt - _CSL_INTC_EVENTID__INTC1START; int x = 1 << (n % 32); int y = n / 32; CSL_sysDataHandle->intcAllocMask[y] &=~ x; /* clear bit -> unused */ hIntc->eventId = CSL_INTC_EVENTID_INVALID; hIntc->vectId = CSL_INTC_VECTID_INVALID; hIntc->priority = CSL_INTC_PRIORITY_INVALID; closeStatus = CSL_SOK; } } return closeStatus;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -