summaryrefslogtreecommitdiff
path: root/firmware/target/arm/system-pp502x.c
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-10-16 10:48:16 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-10-16 10:48:16 +0000
commit1d1a17c0dbd0fdf2857c5d1636713247d28f1762 (patch)
tree863d40550a3f6da5406d65471b3593bde9f9d8d5 /firmware/target/arm/system-pp502x.c
parent8b44601a7c306611b9aba29a7774708585c97539 (diff)
downloadrockbox-1d1a17c0dbd0fdf2857c5d1636713247d28f1762.tar.gz
rockbox-1d1a17c0dbd0fdf2857c5d1636713247d28f1762.zip
Improved H10 ADC driver. We now do things exactly as the OF does. This includes shifting the readings by 0x14 when PLL is enabled. Battery voltages and remote/scrollpad values adjusted accordingly. We also now wait for the ADC to indicate the conversion is complete before reading the data, so hopefully we will get more reliably steady readings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15141 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/system-pp502x.c')
-rw-r--r--firmware/target/arm/system-pp502x.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index d24d19f747..0882d9f212 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -240,17 +240,17 @@ void system_init(void)
240 { 240 {
241#if defined(SANSA_E200) || defined(SANSA_C200) 241#if defined(SANSA_E200) || defined(SANSA_C200)
242 /* Reset all devices */ 242 /* Reset all devices */
243 DEV_OFF_MASK |= 0x20; 243 DEV_RS2 |= 0x20;
244 DEV_RS = 0x3bfffef8; 244 DEV_RS = 0x3bfffef8;
245 DEV_OFF_MASK = -1; 245 DEV_RS2 = -1;
246 DEV_RS = 0; 246 DEV_RS = 0;
247 DEV_OFF_MASK = 0; 247 DEV_RS2 = 0;
248 #elif defined (IRIVER_H10) 248 #elif defined (IRIVER_H10)
249 DEV_RS = 0x3ffffef8; 249 DEV_RS = 0x3ffffef8;
250 DEV_OFF_MASK = -1; 250 DEV_RS2 = -1;
251 outl(inl(0x70000024) | 0xc0, 0x70000024); 251 outl(inl(0x70000024) | 0xc0, 0x70000024);
252 DEV_RS = 0; 252 DEV_RS = 0;
253 DEV_OFF_MASK = 0; 253 DEV_RS2 = 0;
254#endif 254#endif
255 255
256#if !defined(SANSA_E200) && !defined(SANSA_C200) 256#if !defined(SANSA_E200) && !defined(SANSA_C200)
@@ -289,7 +289,7 @@ void system_init(void)
289 outl(inl(0x6000a000) | 0x80000000, 0x6000a000); /* Init DMA controller? */ 289 outl(inl(0x6000a000) | 0x80000000, 0x6000a000); /* Init DMA controller? */
290#endif 290#endif
291 291
292 DEV_INIT |= 1 << 30; /* enable PLL power */ 292 DEV_INIT2 |= 1 << 30; /* enable PLL power */
293 293
294#ifdef HAVE_ADJUSTABLE_CPU_FREQ 294#ifdef HAVE_ADJUSTABLE_CPU_FREQ
295#if NUM_CORES > 1 295#if NUM_CORES > 1