请教 __attribute__ 属性定义的含义
请教一下,下面这段定义是什么意思?从SPI主端发过来的数会存在slaver_data_buffer中,但在程序中却没有赋值的动作,这是如何实现的?
#ifndef __ICCARM__
__attribute__((__section__(".spi_section"))) static uint8_t slaver_data_buffer = {0};
#else
_Pragma("location=\".spi_section\"") _Pragma("data_alignment=512") static uint8_t slaver_data_buffer = {0};
#endif 这段是将slaver_data_buffer定义到了一个新的段(section)里面,然后应该是配合链接脚本,有这个段的起始地址,你可以全局搜索一下字符串“spi_section”,会有相关代码的 没赋值这个变量,可能操作了这个段名? 会不会跟DMA有关 看map文件,slaver_data_buffer 指定在“spi_section”区,spi可以直接指定给该区域进行赋值($$Image$$SPI_SECTION$$Base),就会实现你说的这种效果
页:
[1]