Skip to content

Commit

Permalink
fix ntp_sync_work_func
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyongzhong0 committed Aug 4, 2021
1 parent 3d7a734 commit 88dc6da
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ntp/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,12 @@ static void ntp_sync_work_func(struct rt_work *work, void *work_data)
if (ntp_check_network())
{
ntp_sync_to_rtc(RT_NULL);
rt_work_submit(work, rt_tick_from_millisecond(NTP_AUTO_SYNC_PERIOD * 1000));
}
else
{
rt_work_submit(work, rt_tick_from_millisecond(5 * 1000));
}
rt_work_submit(work, rt_tick_from_millisecond(NTP_AUTO_SYNC_PERIOD * 1000));
}

static int ntp_auto_sync_init(void)
Expand Down

0 comments on commit 88dc6da

Please sign in to comment.