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.

msp430使用CCS定义全局变量的问题

Other Parts Discussed in Thread: MSP430FR6047

我使用的是msp430fr6047。

我在一个头文件中做了一个define:

#define REG_HOLDING_START                   1000

在main.c中定义一个全局变量:

unsigned short RegHoldingStart = REG_HOLDING_START;

在另一个文件中使用这个全局变量:

extern unsigned short RegHoldingStart;

但是在仿真时发现这个全局变量发生了变化(我没有其他任何对此变量赋值的操作,其他如此定义的全局变量也出现了这个问题)。

请问是我哪里操作错了吗?