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.

[参考译文] RTOS/SIMPLELINK-MSP432-SDK:RTC 和 TIRTOS (SYS/BIOS)

Guru**** 2540720 points
Other Parts Discussed in Thread: SIMPLELINK-MSP432-SDK, SYSBIOS

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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/584288/rtos-simplelink-msp432-sdk-rtc-and-tirtos-sys-bios

器件型号:SIMPLELINK-MSP432-SDK
Thread 中讨论的其他器件: SYSBIOS

工具/软件:TI-RTOS

您好!

我一直将 MSP432与全新 SimpleLink-MSP432-SDK 中的 TI-RTOS 搭配使用。 我的应用程序需要记录时间戳。 我已经尝试使用  ti.sysbios.hal.seconds 模块以 UNIX 格式获取秒数、但我注意到用于生成时间戳的源是系统的节拍。 我想使用外部 RTC 模块来确保日期/时间精度。 为了更改秒时钟源、我需要做什么?

谢谢。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    您似乎需要使用 SecondsCallback 模块并提供两个用于设置和获取当前时间的函数。

    在.cfg 文件中添加以下内容:

    VAR 秒= xdc.useModule('ti.sysbios.hal.Seconds');
    VAR SecondsCallback = xdc.useModule('ti.sysbios.hal.SecondsCallback');
    seconds.SecondsProxy =第二回调;
    SecondsCallback.getFxn ='&myGetSeconds;
    SecondsCallback.SetFxn ='&mySetSeconds;

    在 C 文件中、定义两个所需的回调函数:

    uint32 myGetSeconds ()

    返回(//*当前时间,以秒为单位*/);


    void mySetSeconds (uint32初始秒)

    /*适当地保存初始秒数*/


    Alan