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: 定义的全局变量未被初始化

Part Number: TMS320F280039


Hi experts:

请帮忙看一下如下应用中的问题,谢谢!

我在Timer0Intc.C文件下定义变量 uint16 a=0,并且在Timer0Int.h文件中将其extern出去,extern uint16 a=0。程序运行后,变量a未在其他地方被幅值,但是会在其他.c文件下被读取。通过在线观测发现a的值并不是0,而是一个随机数。我将中断函数里的任务减少,发现a就可以被初始化0,请问什么原因会导致外部全局变量没有被初始化呢?