summaryrefslogtreecommitdiff
path: root/firmware/drivers/rtc/rtc_e8564.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/rtc/rtc_e8564.c')
-rw-r--r--firmware/drivers/rtc/rtc_e8564.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/firmware/drivers/rtc/rtc_e8564.c b/firmware/drivers/rtc/rtc_e8564.c
index 7a02ec6cdc..7837bbaa83 100644
--- a/firmware/drivers/rtc/rtc_e8564.c
+++ b/firmware/drivers/rtc/rtc_e8564.c
@@ -25,7 +25,7 @@
25#include "kernel.h" 25#include "kernel.h"
26#include "system.h" 26#include "system.h"
27#include "i2c-pp.h" 27#include "i2c-pp.h"
28#include <stdbool.h> 28#include "timefuncs.h"
29 29
30/*RTC_E8564's slave address is 0x51*/ 30/*RTC_E8564's slave address is 0x51*/
31#define RTC_ADDR 0x51 31#define RTC_ADDR 0x51
@@ -83,9 +83,11 @@ int rtc_read_datetime(struct tm *tm)
83 tm->tm_min = BCD2DEC(buf[1] & 0x7f); 83 tm->tm_min = BCD2DEC(buf[1] & 0x7f);
84 tm->tm_hour = BCD2DEC(buf[2] & 0x3f); 84 tm->tm_hour = BCD2DEC(buf[2] & 0x3f);
85 tm->tm_mday = BCD2DEC(buf[3] & 0x3f); 85 tm->tm_mday = BCD2DEC(buf[3] & 0x3f);
86 tm->tm_wday = BCD2DEC(buf[4] & 0x7);
87 tm->tm_mon = BCD2DEC(buf[5] & 0x1f) - 1; 86 tm->tm_mon = BCD2DEC(buf[5] & 0x1f) - 1;
88 tm->tm_year = BCD2DEC(buf[6]) + 100; 87 tm->tm_year = BCD2DEC(buf[6]) + 100;
88 tm->tm_yday = 0; /* Not implemented for now */
89
90 set_day_of_week(tm);
89 91
90 return read; 92 return read;
91} 93}