- __align(32):
- 变量的数据进行32字节对齐。
- __attribute __ ((at(0X68000000))); :
- __attribute __ ()本身用于修改变量属性。
- at()即为修改变量的地址属性。
-
- 首先 变量可以定义在RAM中和ROM中,之间的写法也是有差异性的
- 在RAM定义中写法
- __align(32) u8 mem2RAMbase[0] __attribute __ ((at(0X68000000)));
- 在ROM定义中写法
- const __align(32) u8 mem2ROMbase[5] __attribute __ ((at(0X08000100))) = = {0x12,0x34,0x56,0x78,0x90};
- * : at后面的地址要保证是可用的RAM地址 .
- * : 变量类型前加上const修饰,否则编译器会报警告 .\
|