summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-01-21 19:37:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-01-21 19:37:29 +0000
commitaaa8443af95aa03b225cea935ff49691ec94d0f9 (patch)
treebfca9b50d6ae6c1cedaf43bec47167ddbddb68c2
parent1774d4d885bd6abab5096b1ea4f57e06caed501f (diff)
downloadrockbox-aaa8443af95aa03b225cea935ff49691ec94d0f9.zip
rockbox-aaa8443af95aa03b225cea935ff49691ec94d0f9.tar.gz
rockbox-aaa8443af95aa03b225cea935ff49691ec94d0f9.tar.bz2
rockbox-aaa8443af95aa03b225cea935ff49691ec94d0f9.tar.xz
Based on Ludovic Lange excellent work, I've modified things to increase
likeliness that this works on an FM Recorder. Reports please! git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3143 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/config-fmrecorder.h6
-rw-r--r--firmware/config-player.h10
-rw-r--r--firmware/config-recorder.h6
-rw-r--r--firmware/drivers/adc.h6
-rw-r--r--firmware/drivers/i2c.c4
-rw-r--r--firmware/drivers/mas.h2
-rw-r--r--firmware/drivers/power.c4
7 files changed, 27 insertions, 11 deletions
diff --git a/firmware/config-fmrecorder.h b/firmware/config-fmrecorder.h
index 3fdb27d..584b1d5 100644
--- a/firmware/config-fmrecorder.h
+++ b/firmware/config-fmrecorder.h
@@ -24,3 +24,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 11059200
+
+/* Battery scale factor (?) */
+#define BATTERY_SCALE_FACTOR 6465
+
+/* Define this if you control power on PBDR (instead of PADR) */
+#define HAVE_POWEROFF_ON_PBDR
diff --git a/firmware/config-player.h b/firmware/config-player.h
index f07a41a..8b4efcc 100644
--- a/firmware/config-player.h
+++ b/firmware/config-player.h
@@ -12,3 +12,13 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 12000000 /* cycle time ~83.3ns */
+
+/* Battery scale factor (?) */
+#define BATTERY_SCALE_FACTOR 6546
+
+/* Define this if you must discharge the data line by driving it low
+ and then set it to input to see if it stays low or goes high */
+#define HAVE_I2C_LOW_FIRST
+
+/* Define this if you control power on PADR (instead of PBDR) */
+#define HAVE_POWEROFF_ON_PADR
diff --git a/firmware/config-recorder.h b/firmware/config-recorder.h
index 2a38cff..7f7c5e2 100644
--- a/firmware/config-recorder.h
+++ b/firmware/config-recorder.h
@@ -21,3 +21,9 @@
/* Define this to the CPU frequency */
#define CPU_FREQ 11059200
+
+/* Battery scale factor (?) */
+#define BATTERY_SCALE_FACTOR 6465
+
+/* Define this if you control power on PBDR (instead of PADR) */
+#define HAVE_POWEROFF_ON_PBDR
diff --git a/firmware/drivers/adc.h b/firmware/drivers/adc.h
index 9c90cb0..f04ab44 100644
--- a/firmware/drivers/adc.h
+++ b/firmware/drivers/adc.h
@@ -38,12 +38,6 @@
#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */
#define ADC_EXT_POWER 7 /* The external power voltage, V=X*0.0148 */
-#ifdef ARCHOS_RECORDER
-#define BATTERY_SCALE_FACTOR 6465
-#else
-#define BATTERY_SCALE_FACTOR 6546
-#endif
-
#define EXT_SCALE_FACTOR 14800
unsigned short adc_read(int channel);
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c
index ccd11e0..97d7a51 100644
--- a/firmware/drivers/i2c.c
+++ b/firmware/drivers/i2c.c
@@ -124,7 +124,7 @@ int i2c_getack(void)
low until it is ready. We need to poll the clock line until it goes
high before we read the ack. */
-#ifndef ARCHOS_RECORDER
+#ifdef HAVE_I2C_LOW_FIRST
SDA_LO; /* First, discharge the data line */
#endif
SDA_INPUT; /* And set to input */
@@ -167,7 +167,7 @@ unsigned char i2c_inb(int ack)
/* clock in each bit, MSB first */
for ( i=0x80; i; i>>=1 ) {
-#ifndef ARCHOS_RECORDER
+#ifdef HAVE_I2C_LOW_FIRST
/* Tricky business. Here we discharge the data line by driving it low
and then set it to input to see if it stays low or goes high */
SDA_LO; /* First, discharge the data line */
diff --git a/firmware/drivers/mas.h b/firmware/drivers/mas.h
index fec0c36..573b9b6 100644
--- a/firmware/drivers/mas.h
+++ b/firmware/drivers/mas.h
@@ -27,7 +27,7 @@
/*
MAS I2C defs
*/
-#ifdef ARCHOS_RECORDER
+#ifdef HAVE_MAS3587F
#define MAS_ADR 0x3c
#define MAS_DEV_WRITE (MAS_ADR | 0x00)
#define MAS_DEV_READ (MAS_ADR | 0x01)
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index bb0ec80..4d8b1ca 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -59,7 +59,7 @@ void charger_enable(bool on)
void ide_power_enable(bool on)
{
-#ifdef ARCHOS_RECORDER
+#ifdef HAVE_ATA_POWER_OFF
if(on)
PADR |= 0x20;
else
@@ -72,7 +72,7 @@ void ide_power_enable(bool on)
void power_off(void)
{
set_irq_level(15);
-#ifdef ARCHOS_RECORDER
+#ifdef HAVE_POWEROFF_ON_PBDR
PBDR &= ~PBDR_BTN_OFF;
PBIOR |= PBDR_BTN_OFF;
#else