Skip to content

Commit

Permalink
pl031:change mktime to timegm.
Browse files Browse the repository at this point in the history
Signed-off-by: yangguangcai <[email protected]>
  • Loading branch information
yangguangcai1 authored and xiaoxiang781216 committed Aug 26, 2024
1 parent 289fc24 commit d6cd953
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/timers/pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static int pl031_settime(FAR struct rtc_lowerhalf_s *lower,

DEBUGASSERT(priv != NULL && rtctime != NULL);

time = mktime((FAR struct tm *)rtctime);
time = timegm((FAR struct tm *)rtctime);
pl031_putreg(time, priv->base, PL031_RTCLR);

return 0;
Expand Down Expand Up @@ -191,7 +191,7 @@ static int pl031_setalarm(FAR struct rtc_lowerhalf_s *lower,
priv->alarm.cb = alarminfo->cb;
priv->alarm.priv = alarminfo->priv;

time = mktime((FAR struct tm *)&alarminfo->time);
time = timegm((FAR struct tm *)&alarminfo->time);

pl031_putreg(time, priv->base, PL031_RTCMR);
pl031_putreg(1, priv->base, PL031_RTCIMSC);
Expand Down

0 comments on commit d6cd953

Please sign in to comment.