diff options
author | Michael Sparmann <theseven@rockbox.org> | 2011-01-02 23:16:27 +0000 |
---|---|---|
committer | Michael Sparmann <theseven@rockbox.org> | 2011-01-02 23:16:27 +0000 |
commit | 152847977a420487d9c3728841101ef708e41373 (patch) | |
tree | f4113d0d6f60355d1ba00d78fc96e97a98e4d493 /firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c | |
parent | 6f40387e742322c4860af2f389a4b531e669801f (diff) | |
download | rockbox-152847977a420487d9c3728841101ef708e41373.tar.gz rockbox-152847977a420487d9c3728841101ef708e41373.zip |
New port: iPod Classic (also known as iPod 6G/6.5G/7G)
Major known issues:
- No bootloader yet
- No support for the first-generation 160GB CE-ATA hard disk drive yet
- Audio playback is slow, only FLAC seems to reach realtime
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28953 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c')
-rw-r--r-- | firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c b/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c new file mode 100644 index 0000000000..76ef8ecb00 --- /dev/null +++ b/firmware/target/arm/s5l8702/ipod6g/rtc-ipod6g.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: rtc-nano2g.c 23114 2009-10-11 18:20:56Z theseven $ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Linus Nielsen Feltzing, Uwe Freese, Laurent Baum | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | #include "rtc.h" | ||
23 | #include "kernel.h" | ||
24 | #include "system.h" | ||
25 | #include "pmu-target.h" | ||
26 | |||
27 | void rtc_init(void) | ||
28 | { | ||
29 | } | ||
30 | |||
31 | int rtc_read_datetime(struct tm *tm) | ||
32 | { | ||
33 | unsigned int i; | ||
34 | unsigned char buf[7]; | ||
35 | |||
36 | pmu_read_rtc(buf); | ||
37 | |||
38 | for (i = 0; i < sizeof(buf); i++) | ||
39 | buf[i] = BCD2DEC(buf[i]); | ||
40 | |||
41 | tm->tm_sec = buf[0]; | ||
42 | tm->tm_min = buf[1]; | ||
43 | tm->tm_hour = buf[2]; | ||
44 | tm->tm_wday = buf[3]; | ||
45 | tm->tm_mday = buf[4]; | ||
46 | tm->tm_mon = buf[5] - 1; | ||
47 | tm->tm_year = buf[6] + 100; | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | int rtc_write_datetime(const struct tm *tm) | ||
53 | { | ||
54 | unsigned int i; | ||
55 | unsigned char buf[7]; | ||
56 | |||
57 | buf[0] = tm->tm_sec; | ||
58 | buf[1] = tm->tm_min; | ||
59 | buf[2] = tm->tm_hour; | ||
60 | buf[3] = tm->tm_wday; | ||
61 | buf[4] = tm->tm_mday; | ||
62 | buf[5] = tm->tm_mon + 1; | ||
63 | buf[6] = tm->tm_year - 100; | ||
64 | |||
65 | for (i = 0; i < sizeof(buf); i++) | ||
66 | buf[i] = DEC2BCD(buf[i]); | ||
67 | |||
68 | pmu_write_rtc(buf); | ||
69 | |||
70 | return 0; | ||
71 | } | ||
72 | |||