public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
89241ed
)
setdate: Fix bugs in BCD mode
author
Alan Cox
<alan@linux.intel.com>
Sat, 25 Aug 2018 18:16:08 +0000
(19:16 +0100)
committer
Alan Cox
<alan@linux.intel.com>
Sat, 25 Aug 2018 18:16:08 +0000
(19:16 +0100)
With these fixed it now works correctly against the DS1302
Applications/util/setdate.c
patch
|
blob
|
history
diff --git
a/Applications/util/setdate.c
b/Applications/util/setdate.c
index
c61cdca
..
9fd8283
100644
(file)
--- a/
Applications/util/setdate.c
+++ b/
Applications/util/setdate.c
@@
-121,8
+121,9
@@
int rtcdate(void)
p = rtc.data.bytes;
for (i = 0; i < 7; i++)
unbc(p++);
+ p = rtc.data.bytes;
/* The date is now effectively encoded in Binary Coded Hundreds */
- tm.tm_year = (
*p * 100) + p[1]
;
+ tm.tm_year = (
(*p * 100) + p[1]) - 1900
;
/* Fall through */
case CMOS_RTC_DEC:
p = rtc.data.bytes;
@@
-159,7
+160,7
@@
int main(int argc, char *argv[])
time_t t;
char newval[128];
int y,m,d,h,s;
- int set;
+ int set
= 0
;
int opt;
int user = 0, autom = 0;