IAR8.10.3编译ZStack-CC2530-2.3.0-1.4.0产生的警告解决方法

http://blog.chinaunix.net/uid-24343357-id-3605556.html

 

分类: 嵌入式

1:Warning[w2]: Symbol ?PBANK is redefined in command-line    

2:Warning[Pe069]: integer conversion resulted in truncation
解决方法,添加下面 红色掩码
#define HAL_DMA_SET_ADDR_DESC0( a ) \
  st( \
    DMA0CFGH = (uint8)( ((uint16)(a)) >> 8 );  \
    DMA0CFGL = (uint8)( ((uint16)(a)) &0x00ff );       \
  )

这个警告产生原因一般是数据在进行类型转换或者取反 ,产生了位数差,进而改变了位数。

http://e2e.ti.com/support/low_power_rf/f/159/t/146154.aspx,是TI论坛的一个帖子,上面有人提供这样的解决方法。

patch文件内容为
--- C:\Texas Instruments\RemoTI-CC253xDK-1.2.1\Components\hal\target\CC2530EB_NPI\hal_dma.h 2010-06-28 15:14:38.000000000 +0100
+++ C:\Texas Instruments\RemoTI-CC253xDK-1.2.1\Components\hal\target\CC2530EB_NPI\hal_dma - Copy.h 2011-11-11 09:11:02.000000000 +0100
@@ -1,10 +1,10 @@
 /**************************************************************************************************
   Filename:       hal_dma.h
-  Revised:        $Date: 2010-05-10 09:54:39 -0700 (Mon, 10 May 2010) $
-  Revision:       $Revision: 22431 $
+  Revised:        $Date: 2010-06-28 15:14:36 -0700 (Mon, 28 Jun 2010) $
+  Revision:       $Revision: 22832 $
 
   Description:     This file contains the interface to the DMA Service.
 
 
   Copyright 2007-2010 Texas Instruments Incorporated. All rights reserved.
 
@@ -58,19 +58,19 @@
  * MACROS
  */
 
 #define HAL_DMA_SET_ADDR_DESC0( a ) \
   st( \
     DMA0CFGH = (uint8)( (uint16)(a) >> 8 );  \
-    DMA0CFGL = (uint8)( (uint16)(a) );       \
+    DMA0CFGL = (uint8)( (uint16)(a) & 0xFF );       \
   )
 
 #define HAL_DMA_SET_ADDR_DESC1234( a ) \
   st( \
     DMA1CFGH = (uint8)( (uint16)(a) >> 8 );  \
-    DMA1CFGL = (uint8)( (uint16)(a) );       \
+    DMA1CFGL = (uint8)( (uint16)(a) & 0xFF );       \
   )
 
 #define HAL_DMA_GET_DESC0()           &dmaCh0
 
 #define HAL_DMA_GET_DESC1234( a )     (dmaCh1234+((a)-1))
 
@@ -87,20 +87,20 @@
 #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); \
+    pDesc->srcAddrL = (uint8)((uint16)(src) & 0xFF); \
   )
 
 // 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); \
+    pDesc->dstAddrL = (uint8)((uint16)(dst) & 0xFF); \
   )
 
 // Macro for quickly setting the number of bytes to be transferred by the DMA,
 // max length is 0x1FFF.
 #define HAL_DMA_SET_LEN( pDesc, len ) \
   st( \

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值