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

📄 csl_intcplugeventhandler.c

📁 TI的DM6446的硬件平台搭建的相关例子
💻 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_intcPlugEventHandler.c * *  @brief  File for functional layer of CSL API @a CSL_intcPlugEventHandler() * *  Description *  - @a CSL_intcPlugEventHandler() function definition * *  Path: \\(CSLPATH)\\soc\\davinci\\arm9\\src\\intc * *  Modification *  - Modified on: 2004/06/12 (Francis S) *  - Reason: Adapted to Hibari/ Davinci * *  - Modified on: 2004/04/15 *  - Reason: creation * *  Date   2004/04/15 *  Author RG Kiran */#include <csl_intc.h>#include <csl_sysData.h>#include <_csl_intc.h>/** ============================================================================ *  @n@b CSL_intcPlugEventHandler * *  @b Description *  @n Associate an event-handler with an event *     CSL_intcPlugEventHandler () ties an event-handler to an event; so *     that the occurence of the event, would result in the event-handler *     being invoked. * *  @b Arguments *  @verbatim        hIntc                Handle identifying the interrupt-event        eventHandlerRecord   Provides the details of the event-handler    @endverbatim * *  <b> Return Value </b> *  @n  Returns the address of the previous handler * *  @b Example: *  @verbatim        CSL_IntcEventHandlerRecord  evtHandlerRecord;        evtHandlerRecord.handler = myIsr;        evtHandlerRecord.arg     = (void *)hTimer;        CSL_intcPlugEventHandler(hIntc, &evtHandlerRecord);    @endverbatim * ============================================================================= */#pragma CODE_SECTION (CSL_intcPlugEventHandler, ".text:csl_section:intc");CSL_IntcEventHandler CSL_intcPlugEventHandler (    CSL_IntcHandle               hIntc,    CSL_IntcEventHandlerRecord  *eventHandlerRecord){    CSL_IntcEventHandler    prevEventHandler = _CSL_INTC_EVTHANDLER_UNPLUGGED;    CSL_IntcEventId         evtId;    /*CSL_IntcPriority      pri;*/    evtId = hIntc->eventId;    /*pri   = (CSL_IntcPriority)hIntc->priority;*/    if ((evtId >= _CSL_INTC_EVENTID__INTC0START) &&        (evtId <= _CSL_INTC_EVENTID__INTC0END)) {        switch(evtId) {            case CSL_INTC_EVENTID_RESET:                /* WILL NOT MAKE SENSE */                break;            case CSL_INTC_EVENTID_UNDEF:                break;            case CSL_INTC_EVENTID_SWI:                break;            case CSL_INTC_EVENTID_PREABT:                break;            case CSL_INTC_EVENTID_DATABT:                break;            case CSL_INTC_EVENTID_IRQ:                /* WILL NOT ALLOW THIS!! */                break;            case CSL_INTC_EVENTID_FIQ:                /* WILL NOT ALLOW THIS!! */                break;        }    }    else {        prevEventHandler =            CSL_sysDataHandle->intcEventHandlerRecord[evtId-                _CSL_INTC_EVENTID__INTC1START+1].handler;        if (eventHandlerRecord == CSL_INTC_EVTHANDLER_NONE) {            CSL_sysDataHandle->intcEventHandlerRecord[evtId-                _CSL_INTC_EVENTID__INTC1START+1].handler =                                                 _CSL_INTC_EVTHANDLER_UNPLUGGED;         /* CSL_sysDataHandle->intcEventHandlerRecord[evtId-           _CSL_INTC_EVENTID__INTC1START+1].arg     =                                                (void *) 0; */ /* irrelevant! */        }        else { /* just do it! */            CSL_sysDataHandle->intcEventHandlerRecord[evtId-                _CSL_INTC_EVENTID__INTC1START+1].handler =                                                    eventHandlerRecord->handler;            CSL_sysDataHandle->intcEventHandlerRecord[evtId-                _CSL_INTC_EVENTID__INTC1START+1].arg     =                                                        eventHandlerRecord->arg;            CSL_sysDataHandle->intcEventHandlerRecord[evtId-                _CSL_INTC_EVENTID__INTC1START+1].evtId   = evtId;        }    }    return prevEventHandler;}

⌨️ 快捷键说明

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