Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法指示 gcc 跳过某些静态、易失性变量的初始化?我有几个循环缓冲区(声明为 volatile),在启动时和我的 MCU 上确实不需要归零,这浪费了大约 2500 tcy。
提前致谢,
如果使用gcc,则可以将数组对象放在该.noinit部分中:
gcc
.noinit
uint8_t arr[1024] __attribute__ ((section (".noinit")));