diff options
author | Robert Kukla <roolku@rockbox.org> | 2007-03-03 00:11:20 +0000 |
---|---|---|
committer | Robert Kukla <roolku@rockbox.org> | 2007-03-03 00:11:20 +0000 |
commit | ae08eeb4ffeadb7b89f913180bdac099fc5c5071 (patch) | |
tree | f17480217ca239b14a6b4ec97d7cb45bf8840cc6 /firmware | |
parent | 909b9462da8387e1c8379a52058c61bf18e222e5 (diff) | |
download | rockbox-ae08eeb4ffeadb7b89f913180bdac099fc5c5071.tar.gz rockbox-ae08eeb4ffeadb7b89f913180bdac099fc5c5071.zip |
remove runtime detection of h1x0 series RTC MOD, but leave driver code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12554 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/common/timefuncs.c | 13 | ||||
-rw-r--r-- | firmware/drivers/fat.c | 20 | ||||
-rw-r--r-- | firmware/drivers/rtc/rtc_ds1339_ds3231.c | 12 | ||||
-rw-r--r-- | firmware/export/config-h120.h | 11 | ||||
-rw-r--r-- | firmware/export/rtc.h | 7 |
5 files changed, 9 insertions, 54 deletions
diff --git a/firmware/common/timefuncs.c b/firmware/common/timefuncs.c index 881bc23e53..e48aadd0a2 100644 --- a/firmware/common/timefuncs.c +++ b/firmware/common/timefuncs.c @@ -49,19 +49,6 @@ struct tm *get_time(void) #ifdef CONFIG_RTC static long timeout = 0; -#if CONFIG_RTC == RTC_DS1339_DS3231 - if(!rtc_detected) { - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 0; - tm.tm_mday = 1; - tm.tm_mon = 0; - tm.tm_year = 70; - tm.tm_wday = 1; - tm.tm_yday = 0; /* Not implemented for now */ - tm.tm_isdst = -1; /* Not implemented for now */ - } else -#endif /* Don't read the RTC more than once per second */ if (current_tick > timeout) { char rtcbuf[7]; diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index e4e77627d0..e3e1a755cb 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -31,9 +31,6 @@ #include "rbunicode.h" #include "logf.h" #include "atoi.h" -#ifdef CONFIG_RTC -#include "rtc.h" -#endif #define BYTES2INT16(array,pos) \ (array[pos] | (array[pos+1] << 8 )) @@ -948,10 +945,6 @@ static void fat_time(unsigned short* date, { #ifdef CONFIG_RTC struct tm* tm = get_time(); -#if CONFIG_RTC == RTC_DS1339_DS3231 - if(rtc_detected) - { -#endif /* CONFIG_RTC == RTC_DS1339_DS3231 */ if (date) *date = ((tm->tm_year - 80) << 9) | @@ -965,14 +958,7 @@ static void fat_time(unsigned short* date, if (tenth) *tenth = (tm->tm_sec & 1) * 100; - -#if CONFIG_RTC == RTC_DS1339_DS3231 - } - else -#endif /* CONFIG_RTC == RTC_DS1339_DS3231 */ -#endif /* CONFIG_RTC */ -#if !defined(CONFIG_RTC) || CONFIG_RTC == RTC_DS1339_DS3231 - { +#else /* non-RTC version returns an increment from the supplied time, or a * fixed standard time/date if no time given as input */ bool next_day = false; @@ -1039,9 +1025,9 @@ static void fat_time(unsigned short* date, } if (tenth) *tenth = 0; - } -#endif /* !defined(CONFIG_RTC) || CONFIG_RTC == RTC_DS1339_DS3231 */ +#endif /* CONFIG_RTC */ } + static int write_long_name(struct fat_file* file, unsigned int firstentry, unsigned int numentries, diff --git a/firmware/drivers/rtc/rtc_ds1339_ds3231.c b/firmware/drivers/rtc/rtc_ds1339_ds3231.c index 7396c2e0a1..e343c96169 100644 --- a/firmware/drivers/rtc/rtc_ds1339_ds3231.c +++ b/firmware/drivers/rtc/rtc_ds1339_ds3231.c @@ -22,17 +22,10 @@ #define RTC_ADDR 0xD0 -bool rtc_detected = false; - void rtc_init(void) { - char byte; - sw_i2c_init(); - /* read one byte from RTC; 0 on success */ - rtc_detected = !sw_i2c_read(RTC_ADDR, 0, &byte, 1); - #ifdef HAVE_RTC_ALARM /* Check + save alarm bit first, before the power thread starts watching */ rtc_check_alarm_started(false); @@ -72,7 +65,8 @@ bool rtc_check_alarm_flag(void) sw_i2c_read(RTC_ADDR, 0x0f, buf, 1); if (buf[0] & 0x02) flag = true; - rtc_enable_alarm(false); + buf[0] = 0x00; + sw_i2c_write(RTC_ADDR, 0x0f, buf, 1); return flag; } @@ -109,7 +103,7 @@ bool rtc_enable_alarm(bool enable) { unsigned char buf[2]; - buf[0] = enable ? 0x26 : 0x04; /* BBSQI INTCN A2IE vs INTCH only */ + buf[0] = enable ? 0x26 : 0x24; /* BBSQI INTCN A2IE vs INTCH only */ buf[1] = 0x00; /* reset alarm flags (and OSF for good measure) */ sw_i2c_write(RTC_ADDR, 0x0e, buf, 2); diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h index 1791bdf78b..e7fb73ea0f 100644 --- a/firmware/export/config-h120.h +++ b/firmware/export/config-h120.h @@ -45,16 +45,7 @@ /* Define this if you do software codec */ #define CONFIG_CODEC SWCODEC -/* Set to 1 if you want to build with RTC support */ -#if 0 -#ifndef SIMULATOR -/* RTC is autodetected on target only */ -#define CONFIG_RTC RTC_DS1339_DS3231 -#define HAVE_RTC_ALARM -#endif -#endif - - /* Define this if you have an remote lcd */ +/* Define this if you have an remote lcd */ #define HAVE_REMOTE_LCD #define CONFIG_LCD LCD_S1D15E06 diff --git a/firmware/export/rtc.h b/firmware/export/rtc.h index 1b0d215371..eea83d85bb 100644 --- a/firmware/export/rtc.h +++ b/firmware/export/rtc.h @@ -20,7 +20,8 @@ #define _RTC_H_ #include <stdbool.h> -#include <system.h> +#include "system.h" +#include "config.h" #ifdef CONFIG_RTC @@ -28,10 +29,6 @@ extern const int dayname[]; extern const int monthname[]; -#if CONFIG_RTC == RTC_DS1339_DS3231 -extern bool rtc_detected; -#endif - /* Common functions for all targets */ void rtc_init(void); int rtc_read_datetime(unsigned char* buf); |