STM32Cube IDE中使用 __align() 报错
#define __align() __attribute__((aligned(x)))
是GCC编译器中的一个宏定义,用于指定变量或结构体的对齐方式,
在STM32Cube IDE 中使用__align()关键词报错:
代码如下:
__align(16) int16_t abcbuffer[BUFSIZE];
错误提示如下:
error: expected declaration specifiers or ‘…’ before numeric constant
这是因为在Cube IDE中 gcc编译器中不识别这个关键字
使用的是大写,换成__ALIGNED()后,编译通过。