summaryrefslogtreecommitdiff
path: root/rtc
diff options
context:
space:
mode:
authorWolfgang Denk <wd@pollux.denx.de>2006-05-03 01:04:58 +0200
committerWolfgang Denk <wd@pollux.denx.de>2006-05-03 01:04:58 +0200
commitda4849fb30db9ec2cb1ae0bafa7455b9c4cb87b3 (patch)
tree0a69dbdcaf777cac5d1a48349b4953bc7014dcfe /rtc
parent983bebbea304f65daf5baa9a913e66ff6e8fa6ba (diff)
Write RTC seconds first to maintain settings integrity per
Maxim/Dallas DS1306 data sheet. Patch by Alan J. Luse, 02 May 2006
Diffstat (limited to 'rtc')
-rw-r--r--rtc/ds1306.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/rtc/ds1306.c b/rtc/ds1306.c
index e143bf7a3df..e01e1ceae97 100644
--- a/rtc/ds1306.c
+++ b/rtc/ds1306.c
@@ -360,13 +360,13 @@ void rtc_set (struct rtc_time *tmp)
tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday,
tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
- rtc_write (RTC_YEAR, bin2bcd (tmp->tm_year - 2000));
- rtc_write (RTC_MONTH, bin2bcd (tmp->tm_mon));
- rtc_write (RTC_DATE_OF_MONTH, bin2bcd (tmp->tm_mday));
- rtc_write (RTC_DAY_OF_WEEK, bin2bcd (tmp->tm_wday + 1));
- rtc_write (RTC_HOURS, bin2bcd (tmp->tm_hour));
- rtc_write (RTC_MINUTES, bin2bcd (tmp->tm_min));
rtc_write (RTC_SECONDS, bin2bcd (tmp->tm_sec));
+ rtc_write (RTC_MINUTES, bin2bcd (tmp->tm_min));
+ rtc_write (RTC_HOURS, bin2bcd (tmp->tm_hour));
+ rtc_write (RTC_DAY_OF_WEEK, bin2bcd (tmp->tm_wday + 1));
+ rtc_write (RTC_DATE_OF_MONTH, bin2bcd (tmp->tm_mday));
+ rtc_write (RTC_MONTH, bin2bcd (tmp->tm_mon));
+ rtc_write (RTC_YEAR, bin2bcd (tmp->tm_year - 2000));
}
/* ------------------------------------------------------------------------- */