工具与软件:
我无法在 portable_CC3235SF_LAUNCHXL_tirtos7_ticlang 中获取日期和时间信息。 我想在 localtime 代码中使用方法、但我无法获取它。
int timeZoneValue = 180;// GMT+3
ClockSync_setTimeZone (timeZoneValue);
struct tm netTime;
int32_t status;
//获取当前时间
status = ClockSync_Get (&netTime);
//检查是否已成功检索时间
如果(STATUS == 0 || STATUS == CLOCKSYNC_ERROR_INTERVAL){
Display_printf (display、0、0、"Local time =%s\n\r"、asctime (&netTime));
其他{
Display_printf (display、0、0、"Error Geting Time =%d\n\r"、status);
}
这样、我想将时间信息打印到串行端口、但收到"getting time="-202"错误。