summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-12-11 02:00:28 +0000
committerDave Chapman <dave@dchapman.com>2005-12-11 02:00:28 +0000
commit060320b95c99d91fd2e72cc1c3aabbad8d99127d (patch)
treec1d9641eb6e6003a3827d8adb6eb975df252f6a0 /uisimulator
parent4b32ec718dc7bda11c803f889d5c86350b871cfa (diff)
downloadrockbox-060320b95c99d91fd2e72cc1c3aabbad8d99127d.tar.gz
rockbox-060320b95c99d91fd2e72cc1c3aabbad8d99127d.tar.bz2
rockbox-060320b95c99d91fd2e72cc1c3aabbad8d99127d.zip
Fix red sim builds - add rtc_read_datetime and rtc_write_datetime functions for the simulator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8218 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/common/stubs.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index 73890378f5..d6170e13ca 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -166,37 +166,36 @@ bool simulate_usb(void)
int rtc_read(int address)
{
- time_t now = time(NULL);
- struct tm *teem = localtime(&now);
-
- switch(address) {
- case 3: /* hour */
- return (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
-
- case 2: /* minute */
- return (teem->tm_min%10) | ((teem->tm_min/10) << 4);
-
- case 1: /* seconds */
- return (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
+ return address ^ 0x55;
+}
- case 7: /* year */
- return ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
+int rtc_write(int address, int value)
+{
+ (void)address;
+ (void)value;
+ return 0;
+}
- case 6: /* month */
- return ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
+int rtc_read_datetime(unsigned char* buf)
+{
+ time_t now = time(NULL);
+ struct tm *teem = localtime(&now);
- case 5: /* day */
- return (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
- }
+ buf[0] = (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
+ buf[1] = (teem->tm_min%10) | ((teem->tm_min/10) << 4);
+ buf[2] = (teem->tm_hour%10) | ((teem->tm_hour/10) << 4);
+ buf[3] = (teem->tm_wday);
+ buf[4] = (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
+ buf[5] = ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
+ buf[6] = ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
- return address ^ 0x55;
+ return 0;
}
-int rtc_write(int address, int value)
+int rtc_write_datetime(unsigned char* buf)
{
- (void)address;
- (void)value;
- return 0;
+ (void)buf;
+ return 0;
}
bool is_new_player(void)