Skip to content

Commit

Permalink
fix: 修复sntp自动同步的代码的编译修改
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Oct 27, 2023
1 parent 7e172ff commit 948785e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions luatos/components/luat/port/luat_sntp_idf5.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ void luat_ntp_autosync(void) {

ntp_auto_sync_started = 1;

sntp_setoperatingmode(SNTP_OPMODE_POLL);
sntp_setservername(0, "ntp.aliyun.com");
sntp_setservername(1, "pool.ntp.org");
esp_sntp_setoperatingmode(SNTP_OPMODE_POLL);
esp_sntp_setservername(0, "ntp.aliyun.com");
esp_sntp_setservername(1, "pool.ntp.org");
#ifdef CONFIG_SNTP_TIME_SYNC_METHOD_SMOOTH
sntp_set_sync_mode(SNTP_SYNC_MODE_SMOOTH);
esp_sntp_set_sync_mode(SNTP_SYNC_MODE_SMOOTH);
#endif
sntp_set_sync_interval(900*1000); // every 60s
sntp_set_time_sync_notification_cb(my_ntp_cb);
sntp_init();
esp_sntp_set_sync_interval(900*1000); // every 60s
esp_sntp_set_time_sync_notification_cb(my_ntp_cb);
esp_sntp_init();
}

0 comments on commit 948785e

Please sign in to comment.