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.

[参考译文] LAUNHXL-CC1312R1:关于使用 IAR 开发 CC1312软件不能使用未初始化的变量

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

https://e2e.ti.com/support/wireless-connectivity/sub-1-ghz-group/sub-1-ghz/f/sub-1-ghz-forum/1084219/launchxl-cc1312r1-about-using-iar-to-develop-cc1312-software-cannot-use-uninitialized-variables

部件号:LAUNHHXL-CC1312R1
“线程:CC1310测试”中讨论的其它部件

我在 IAR 开发 CC1312软件,发现__NO_INIT 临时定义不起作用。  在 CC1312连续电复位后,温度始终初始化为0,而不是按照定义取消初始化。  我对 CC1310进行了相同的测试验证,结果与定义一致。  为什么 CC1312的结果会有所不同?  

代码:

__NO_INIT uint8_t 临时;

printf("%d\n", temp);

temp++;

printf("%d\n", temp);

延迟_100ms();

SystemReset();

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

    您好,

    我们不支持使用__NO_init。 对于需要保持设备重置的数据,我建议将其存储在闪存中。 您可以为此使用 NVS 驱动程序。

    谢谢,

    玛丽·H

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

    好的,我明白了。 感谢你的回复。