- 首先,打开"C:\Texas Instruments\ZStack-CC2530-2.3.0-1.4.0\Components\hal\target\CC2530EB\hal_dma.h";
- 找到“hal_dma.h”文件中的一段代码,如下所示:
/*********************************************************************
* MACROS
*/
#define HAL_DMA_SET_ADDR_DESC0( a ) \
st( \
DMA0CFGH = (uint8)( (uint16)(a) >> 8 ); \
DMA0CFGL = (uint8)( (uint16)(a)&0x00ff); \
)
#define HAL_DMA_SET_ADDR_DESC1234( a ) \
st( \
DMA1CFGH = (uint8)( (uint16)(a) >> 8 ); \
DMA1CFGL = (uint8)( (uint16)(a)&0x00ff); \
)
#define HAL_DMA_GET_DESC0() &dmaCh0
#define HAL_DMA_GET_DESC1234( a ) (dmaCh1234+((a)-1))
#define HAL_DMA_ARM_CH( ch ) DMAARM = (0x01 << (ch))
#define HAL_DMA_CH_ARMED( ch ) (DMAARM & (0x01 << (ch)))
#define HAL_DMA_ABORT_CH( ch ) DMAARM = (0x80 | (0x01 << (ch)))
#define HAL_DMA_MAN_TRIGGER( ch ) DMAREQ = (0x01 << (ch))
#define HAL_DMA_START_CH( ch ) HAL_DMA_MAN_TRIGGER( (ch) )
#define HAL_DMA_CLEAR_IRQ( ch ) DMAIRQ &= ~( 1 << (ch) )
#define HAL_DMA_CHECK_IRQ( ch ) (DMAIRQ & ( 1 << (ch) ))
// Macro for quickly setting the source address of a DMA structure.
#define HAL_DMA_SET_SOURCE( pDesc, src ) \
st( \
pDesc->srcAddrH = (uint8)((uint16)(src) >> 8); \
pDesc->srcAddrL = (uint8)((uint16)(src) & 0x00ff); \
)
// Macro for quickly setting the destination address of a DMA structure.
#define HAL_DMA_SET_DEST( pDesc, dst ) \
st( \
pDesc->dstAddrH = (uint8)((uint16)(dst) >> 8); \
pDesc->dstAddrL = (uint8)((uint16)(dst) & 0x00ff); \
)
- 将你的“hal_dma.h”文件中的这行代码按照以上代码进行修改,然后保存并编译,会发现该警告已消除。