大家好、
客户有问题需要您的帮助:
我在 Timer0Intc.C 文件下将变量 uint16 a=0定义为0、并在 Timer0Int.h 文件中将其 extern uint16 a=0。 程序运行后、变量 a 在其他地方没有值、但它将在其他.c 文件中读取。 通过在线观察、可以发现 a 的值不是0、而是一个随机数。 我减少了中断函数中的任务、发现 A 可以初始化为0。 是什么导致外部全局变量无法初始化?
谢谢。此致、
本
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
大家好、
客户有问题需要您的帮助:
我在 Timer0Intc.C 文件下将变量 uint16 a=0定义为0、并在 Timer0Int.h 文件中将其 extern uint16 a=0。 程序运行后、变量 a 在其他地方没有值、但它将在其他.c 文件中读取。 通过在线观察、可以发现 a 的值不是0、而是一个随机数。 我减少了中断函数中的任务、发现 A 可以初始化为0。 是什么导致外部全局变量无法初始化?
谢谢。此致、
本
我明白了。
以下是相关资源:
https://software-dl.ti.com/C2000/docs/optimization_guide/phase1/misc.html#uninitialized-variables