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.

msp430f5438a在编程是数据被截断,IAR环境

uint32_t TotalSize = 2 * 1024 * 1024;编译出现警告,调试发现TotalSize =0;感觉TotalSize 是按照16位来处理的,不知道是不是IAR环境配置的问题,请高手指点下

  • 不建议这样定义变量。

    1、这样的乘法运算在msp430中会占用大量运算时间的。

    2、1024 * 1024这种运算结果很可能会超出16位造成溢出或者运算错误,而不是自动产生一个32位的结果

    不清楚你的警告信息具体内容是什么,具体还要根据提示信息进行调整或修改。