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.

[参考译文] LAUNCHXL-CC26X2R1:向 simplebleperipheral 添加 seconds_get

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

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1130879/launchxl-cc26x2r1-adding-seconds_get-to-simplebleperipheral

器件型号:LAUNCHXL-CC26X2R1
Thread 中讨论的其他器件:SYSBIOS

您好!

我以前能够通过将以下内容添加到工程 cfg 文件中来使用 seconds API。

VAR 秒= xdc.useModule('ti.sysbios.hal.Seconds');

我在最新 SDK 的 simplebleperipheral 示例中看不到该项目 cfg 文件。

那么、如何添加它呢? 否则、在构建时会显示

未解析的符号 seconds_get()

谢谢

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

    您好、Kazola、

    出现此问题的原因是 BIOS6迁移到 BIOS7 (导入项目时显示为 tirtos7)。

    要使用秒模块,您只需添加正确的包含路径即可。 下面是 BIOS7用户指南的一个片段

    #include <time.h>
    #include <ti/sysbios/hal/Seconds.h>
    
    uint32_t t;
    //..
    //..
    /* set to today’s date in seconds since Jan 1, 1970 */
    Seconds_set(1412800000); /* Wed, 08 Oct 2014 20:26:40 GMT */
    /* retrieve current time relative to Jan 1, 1970 */
    t = Seconds_get();

    如需了解更多详细信息、此处 也提供了迁移指南文档。