首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

嵌入式开发板光盘中的代码,读不懂。该如何处理

2012-02-23 
嵌入式开发板光盘中的代码,读不懂。。。。。。节选如下,谁能大体给说说是什么意思?(*(volatile unsigned *)是什

嵌入式开发板光盘中的代码,读不懂。。。。。。
节选如下,谁能大体给说说是什么意思?(*(volatile unsigned *)是什么意思?

#define rBWSCON (*(volatile unsigned *)0x48000000)//Bus width & wait status
#define rBANKCON0 (*(volatile unsigned *)0x48000004)//Boot ROM control
#define rBANKCON1 (*(volatile unsigned *)0x48000008)//BANK1 control
#define rBANKCON2 (*(volatile unsigned *)0x4800000c)//BANK2 cControl
#define rBANKCON3 (*(volatile unsigned *)0x48000010)//BANK3 control
#define rBANKCON4 (*(volatile unsigned *)0x48000014)//BANK4 control
#define rBANKCON5 (*(volatile unsigned *)0x48000018)//BANK5 control
#define rBANKCON6 (*(volatile unsigned *)0x4800001c)//BANK6 control
#define rBANKCON7 (*(volatile unsigned *)0x48000020)//BANK7 control
#define rREFRESH (*(volatile unsigned *)0x48000024)//DRAM/SDRAM refresh
#define rBANKSIZE (*(volatile unsigned *)0x48000028)//Flexible Bank Size
#define rMRSRB6 (*(volatile unsigned *)0x4800002c)//Mode register set for SDRAM
#define rMRSRB7 (*(volatile unsigned *)0x48000030)//Mode register set for SDRAM


[解决办法]
#define rBWSCON (*(volatile unsigned *)) //Bus width & wait status 

0x48000000是内存地址,(volatile unsigned *)是说把这个地址按照unsigned型对待,volatile是告诉编译器不做优化,这个地址每一次赋值操作都真正赋值。最前面的星号是取值,因为说明了要把地址看成unsigned型的,所以最后得到的值是0x48000000位置的一个unsigned型的值. 前面的#define不用解释了

热点排行