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.

CCS5.2在执行DSP赋值语句时两个变量无法赋值

Other Parts Discussed in Thread: TMS320F28335

出现问题的代码形式为:

static float a=16000;

int hanshu(void)

{

      float  b;

      b=a;

}

在执行过b=a指令后,b的值没有变成16000而是变成0,但是如果把代码改为

static float a=16000;

static  float  b;

int hanshu(void)

{

      b=a;

}

则执行完b=a后,b=16000

DSP型号为TMS320F28335,仿真器为SEED510,求哪位仁兄帮助解答下

  • 你好,查看变量b的时候请单步运行,上面一段代码中b属于hanshu函数内的局部变量,就是说程序跳出hanshu函数后b的值也就没有意义了。因此查看b的值时要在hanshu函数没有退出时查看。