diff options
author | Bertrik Sikken <bertrik@sikken.nl> | 2010-01-30 13:04:00 +0000 |
---|---|---|
committer | Bertrik Sikken <bertrik@sikken.nl> | 2010-01-30 13:04:00 +0000 |
commit | 529206694bee359cf9923fea5bd7ce40fc304025 (patch) | |
tree | 356c29c1ca8591270145a9bcc9f2e9a379ecd277 | |
parent | 442084bce9a06384aaf3ad554a1653b59514807c (diff) | |
download | rockbox-529206694bee359cf9923fea5bd7ce40fc304025.tar.gz rockbox-529206694bee359cf9923fea5bd7ce40fc304025.zip |
fix warnings in s35390 rtc driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24380 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/drivers/rtc/rtc_s35390a.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/firmware/drivers/rtc/rtc_s35390a.c b/firmware/drivers/rtc/rtc_s35390a.c index 0b95431330..13027d31a2 100644 --- a/firmware/drivers/rtc/rtc_s35390a.c +++ b/firmware/drivers/rtc/rtc_s35390a.c | |||
@@ -61,7 +61,8 @@ void rtc_init(void) | |||
61 | int rtc_read_datetime(struct tm *tm) | 61 | int rtc_read_datetime(struct tm *tm) |
62 | { | 62 | { |
63 | unsigned char buf[7]; | 63 | unsigned char buf[7]; |
64 | int i, ret; | 64 | unsigned int i; |
65 | int ret; | ||
65 | 66 | ||
66 | ret = i2c_read(RTC_ADDR | (REALTIME_DATA1 << 1), -1, sizeof(buf), buf); | 67 | ret = i2c_read(RTC_ADDR | (REALTIME_DATA1 << 1), -1, sizeof(buf), buf); |
67 | reverse_bits(buf, sizeof(buf)); | 68 | reverse_bits(buf, sizeof(buf)); |
@@ -69,7 +70,7 @@ int rtc_read_datetime(struct tm *tm) | |||
69 | buf[4] &= 0x3f; /* mask out p.m. flag */ | 70 | buf[4] &= 0x3f; /* mask out p.m. flag */ |
70 | 71 | ||
71 | for (i = 0; i < sizeof(buf); i++) | 72 | for (i = 0; i < sizeof(buf); i++) |
72 | BCD2DEC(buf[i]); | 73 | buf[i] = BCD2DEC(buf[i]); |
73 | 74 | ||
74 | tm->tm_sec = buf[6]; | 75 | tm->tm_sec = buf[6]; |
75 | tm->tm_min = buf[5]; | 76 | tm->tm_min = buf[5]; |
@@ -85,7 +86,8 @@ int rtc_read_datetime(struct tm *tm) | |||
85 | int rtc_write_datetime(const struct tm *tm) | 86 | int rtc_write_datetime(const struct tm *tm) |
86 | { | 87 | { |
87 | unsigned char buf[7]; | 88 | unsigned char buf[7]; |
88 | int i, ret; | 89 | unsigned int i; |
90 | int ret; | ||
89 | 91 | ||
90 | buf[6] = tm->tm_sec; | 92 | buf[6] = tm->tm_sec; |
91 | buf[5] = tm->tm_min; | 93 | buf[5] = tm->tm_min; |
@@ -96,7 +98,7 @@ int rtc_write_datetime(const struct tm *tm) | |||
96 | buf[0] = tm->tm_year - 100; | 98 | buf[0] = tm->tm_year - 100; |
97 | 99 | ||
98 | for (i = 0; i < sizeof(buf); i++) | 100 | for (i = 0; i < sizeof(buf); i++) |
99 | DEC2BCD(buf[i]); | 101 | buf[i] = DEC2BCD(buf[i]); |
100 | 102 | ||
101 | reverse_bits(buf, sizeof(buf)); | 103 | reverse_bits(buf, sizeof(buf)); |
102 | ret = i2c_write(RTC_ADDR | (REALTIME_DATA1 << 1), -1, sizeof(buf), buf); | 104 | ret = i2c_write(RTC_ADDR | (REALTIME_DATA1 << 1), -1, sizeof(buf), buf); |