Thread 中讨论的其他器件: SYSBIOS
如何在 cc2650 Launchpad 中使用 RTC。 我希望 在每 5分钟后仅使用 RTC 打开和关闭 LED。
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.
您好、Ashwini、
请参阅 有关 AON_RTC Driverlib 的文档 和此 相关的 E2E 主题。
此致、
Ryan
感谢 Ryan 的回复、现在我 正在访问此链接(https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/859344/cc2650-by-using-always-on-domain-how-to-print-current-date-and-time)
#include
#include
#include
#include
#include
#include
char func;
char func1;
uint32_t func2;
uint32_t func4;
uint32_t 秒;
uint32_t 电池;
time_t t1;
uint32_t;
struct tm *ltm;
char *curTime;
辅助字符1;
字符 str;
uint8_t str1;
uint8_t str2;
int main()
{
/*启动内核。 *
AONRTCEnable();
func=AONRTCActive();
AONRTCEventClear (AON_RTC_CH1);
AONRTCCompareValueSet (AON_RTC_CH1、0x5dddcc54);
AONRTCChannelEnable (AON_RTC_CH1);
AONRTCChannelEnable (AON_RTC_CH0);
func1=AONRTCChannelActive (AON_RTC_CH1);
AONRTCCombinedEventConfig (AON_RTC_CH0 | AON_RTC_CH1);
func4= AONRTCCompareValueGet (AON_RTC_CH1);
秒= AONRTCSecGet ();
system_printf ("seconds=%s %d\r\n"、秒、秒);
system_flush();
seconds_set (func4);
t =seconds_getTime (func4);
T1 =时间(t);LTM = localtime (&T1);
curTime =上升时间(LTM);
System_printf ("time (GMT):%s\n"、curTime);
system_flush();
BIOS_start();
返回0;
}
我得到结果、但这不是当前时间和日期。
seconds=(null) 0
时间(GMT):星期三2019年11月27日01:07:32
当我调用此函数时、我得到零或0输出。
请更正我出错的地方。
CC2650上没有时钟、包括 RTC、可在 断电期间保留其值。 因此、您在没有引用的情况下获得的时间戳不能合理地是当前日期。 这很可能是出厂编程设置(即 UNIX 时间不能早于设备创建时间)。 您将需要手动设置电流值、将时间信息存储在非易失性闪存中、保持器件开启、包括备用电池、并考虑器件断电的时间。
https://e2e.ti.com/f/1/t/484591
https://e2e.ti.com/f/1/t/697119
此致、
Ryan