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.

[参考译文] TMS320F280039:定义的全局变量未初始化

Guru**** 2394305 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1257314/tms320f280039-global-variable-defined-is-not-initialized

器件型号:TMS320F280039

大家好、

客户有问题需要您的帮助:

我在 Timer0Intc.C 文件下将变量 uint16 a=0定义为0、并在 Timer0Int.h 文件中将其 extern   uint16 a=0。  程序运行后、变量 a 在其他地方没有值、但它将在其他.c 文件中读取。  通过在线观察、可以发现 a 的值不是0、而是一个随机数。  我减少了中断函数中的任务、发现 A 可以初始化为0。 是什么导致外部全局变量无法初始化?

谢谢。此致、