dmafreechannel.c

来自「zigbee通信系统中使用芯片cc2430实现点对点通信的源码」· C语言 代码 · 共 34 行

C
34
字号
/******************************************************************************
Filename:     dmaFreeChannel.c
Target:       cc2430
Revised:      16/12-2005
Revision:     1.0
******************************************************************************/

#include <string.h>
#include "cul.h"

extern DMA_DESC __xdata dmaChannel1to4[4];
extern DMA_TABLE_ENTRY dmaTable[DMA_ADM_NUMBER_OF_CHANNELS];

//-----------------------------------------------------------------------------
// See cul.h for a description of this function.
//-----------------------------------------------------------------------------
void culDmaFreeChannel(BYTE dmaChannelNumber){
   // Saving the old interrupt enable status and turning off global interrupt.
   BYTE savedIntEnable = IEN0;
   INT_GLOBAL_ENABLE(INT_OFF);

   // Turning off the DMA channel
   DMA_ABORT_CHANNEL(dmaChannelNumber);

   // Clearing the channel occupied flag in the table
   dmaTable[dmaChannelNumber].assigned = FALSE;
   dmaTable[dmaChannelNumber].callBackFunction = NULL;

   // Restoring the interrupt enable status
   IEN0 = savedIntEnable;

   return;
} // ends culDmaFreeChannel()

⌨️ 快捷键说明

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