用户可以在文件 include_lib/net/lwip_2_1_3/lwip/app/ntp/ntp.h 添加自己的ntp服务器:
//此处添加ntp服务器,请自行测试ntp服务器是否正常
static const char *ntp_host[] = {
“s2a.time.edu.cn”,
“s2b.time.edu.cn”,
“s2c.time.edu.cn”,
// “s2d.time.edu.cn”,
// “s2e.time.edu.cn”,
// “s2f.time.edu.cn”,
// “s2g.time.edu.cn”,
// “s2h.time.edu.cn”,
// “s2j.time.edu.cn”,
// “s2k.time.edu.cn”,
// “s2m.time.edu.cn”,
};
打印控制,用户可以打开关闭DEBUG,ERR打印信息
#define NTP_DBUG_INFO_ON 0 /*!< NTP client debug information on/off /
#define NTP_ERR_INFO_ON 1 /!< NTP client error information on/off */
用户可以在文件 apps/common/net/wifi_conf.c 中配置是否开机调用ntp
const u8 ntp_get_time_init = 1; //连上网后调用ntp向ntp_host列表所有服务器获取时间, 0为关闭, 1为开启