Skip to content

Commit

Permalink
Merge pull request #72 from mysterywolf/ntp
Browse files Browse the repository at this point in the history
修复4.0.3版本里不能设置日期的bug
  • Loading branch information
armink authored May 27, 2021
2 parents 80ba28e + 33c8e2a commit 6ff6748
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ntp/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ time_t ntp_sync_to_rtc(const char *host_name)
struct tm *cur_tm;
cur_tm = localtime(&cur_time);
set_time(cur_tm->tm_hour, cur_tm->tm_min, cur_tm->tm_sec);
cur_tm = localtime(&cur_time);
set_date(cur_tm->tm_year + 1900, cur_tm->tm_mon + 1, cur_tm->tm_mday);
#else
rt_device_control(rt_device_find("rtc"), RT_DEVICE_CTRL_RTC_SET_TIME, &cur_time);
Expand Down

0 comments on commit 6ff6748

Please sign in to comment.