summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 3fdb27dfb9..584b1d5d54 100644
--- a/firmware/config-fmrecorder.h
+++ b/firmware/config-fmrecorder.h
@@ -24,3 +24,9 @@
24 24
25/* Define this to the CPU frequency */ 25/* Define this to the CPU frequency */
26#define CPU_FREQ 11059200 26#define CPU_FREQ 11059200
27
28/* Battery scale factor (?) */
29#define BATTERY_SCALE_FACTOR 6465
30
31/* Define this if you control power on PBDR (instead of PADR) */
32#define HAVE_POWEROFF_ON_PBDR
diff --git a/firmware/config-player.h b/firmware/config-player.h
index f07a41aacc..8b4efcc7b4 100644
--- a/firmware/config-player.h
+++ b/firmware/config-player.h
@@ -12,3 +12,13 @@
12 12
13/* Define this to the CPU frequency */ 13/* Define this to the CPU frequency */
14#define CPU_FREQ 12000000 /* cycle time ~83.3ns */ 14#define CPU_FREQ 12000000 /* cycle time ~83.3ns */
15
16/* Battery scale factor (?) */
17#define BATTERY_SCALE_FACTOR 6546
18
19/* Define this if you must discharge the data line by driving it low
20 and then set it to input to see if it stays low or goes high */
21#define HAVE_I2C_LOW_FIRST
22
23/* Define this if you control power on PADR (instead of PBDR) */
24#define HAVE_POWEROFF_ON_PADR
diff --git a/firmware/config-recorder.h b/firmware/config-recorder.h
index 2a38cff7d2..7f7c5e2683 100644
--- a/firmware/config-recorder.h
+++ b/firmware/config-recorder.h
@@ -21,3 +21,9 @@
21 21
22/* Define this to the CPU frequency */ 22/* Define this to the CPU frequency */
23#define CPU_FREQ 11059200 23#define CPU_FREQ 11059200
24
25/* Battery scale factor (?) */
26#define BATTERY_SCALE_FACTOR 6465
27
28/* Define this if you control power on PBDR (instead of PADR) */
29#define HAVE_POWEROFF_ON_PBDR
diff --git a/firmware/drivers/adc.h b/firmware/drivers/adc.h
index 9c90cb08a7..f04ab4466d 100644
--- a/firmware/drivers/adc.h
+++ b/firmware/drivers/adc.h
@@ -38,12 +38,6 @@
38#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */ 38#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */
39#define ADC_EXT_POWER 7 /* The external power voltage, V=X*0.0148 */ 39#define ADC_EXT_POWER 7 /* The external power voltage, V=X*0.0148 */
40 40
41#ifdef ARCHOS_RECORDER
42#define BATTERY_SCALE_FACTOR 6465
43#else
44#define BATTERY_SCALE_FACTOR 6546
45#endif
46
47#define EXT_SCALE_FACTOR 14800 41#define EXT_SCALE_FACTOR 14800
48 42
49unsigned short adc_read(int channel); 43unsigned short adc_read(int channel);
diff --git a/firmware/drivers/i2c.c b/firmware/drivers/i2c.c
index ccd11e01de..97d7a511e1 100644
--- a/firmware/drivers/i2c.c
+++ b/firmware/drivers/i2c.c
@@ -124,7 +124,7 @@ int i2c_getack(void)
124 low until it is ready. We need to poll the clock line until it goes 124 low until it is ready. We need to poll the clock line until it goes
125 high before we read the ack. */ 125 high before we read the ack. */
126 126
127#ifndef ARCHOS_RECORDER 127#ifdef HAVE_I2C_LOW_FIRST
128 SDA_LO; /* First, discharge the data line */ 128 SDA_LO; /* First, discharge the data line */
129#endif 129#endif
130 SDA_INPUT; /* And set to input */ 130 SDA_INPUT; /* And set to input */
@@ -167,7 +167,7 @@ unsigned char i2c_inb(int ack)
167 167
168 /* clock in each bit, MSB first */ 168 /* clock in each bit, MSB first */
169 for ( i=0x80; i; i>>=1 ) { 169 for ( i=0x80; i; i>>=1 ) {
170#ifndef ARCHOS_RECORDER 170#ifdef HAVE_I2C_LOW_FIRST
171 /* Tricky business. Here we discharge the data line by driving it low 171 /* Tricky business. Here we discharge the data line by driving it low
172 and then set it to input to see if it stays low or goes high */ 172 and then set it to input to see if it stays low or goes high */
173 SDA_LO; /* First, discharge the data line */ 173 SDA_LO; /* First, discharge the data line */
diff --git a/firmware/drivers/mas.h b/firmware/drivers/mas.h
index fec0c36ed7..573b9b6b37 100644
--- a/firmware/drivers/mas.h
+++ b/firmware/drivers/mas.h
@@ -27,7 +27,7 @@
27/* 27/*
28 MAS I2C defs 28 MAS I2C defs
29*/ 29*/
30#ifdef ARCHOS_RECORDER 30#ifdef HAVE_MAS3587F
31#define MAS_ADR 0x3c 31#define MAS_ADR 0x3c
32#define MAS_DEV_WRITE (MAS_ADR | 0x00) 32#define MAS_DEV_WRITE (MAS_ADR | 0x00)
33#define MAS_DEV_READ (MAS_ADR | 0x01) 33#define MAS_DEV_READ (MAS_ADR | 0x01)
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index bb0ec80942..4d8b1cabb8 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -59,7 +59,7 @@ void charger_enable(bool on)
59 59
60void ide_power_enable(bool on) 60void ide_power_enable(bool on)
61{ 61{
62#ifdef ARCHOS_RECORDER 62#ifdef HAVE_ATA_POWER_OFF
63 if(on) 63 if(on)
64 PADR |= 0x20; 64 PADR |= 0x20;
65 else 65 else
@@ -72,7 +72,7 @@ void ide_power_enable(bool on)
72void power_off(void) 72void power_off(void)
73{ 73{
74 set_irq_level(15); 74 set_irq_level(15);
75#ifdef ARCHOS_RECORDER 75#ifdef HAVE_POWEROFF_ON_PBDR
76 PBDR &= ~PBDR_BTN_OFF; 76 PBDR &= ~PBDR_BTN_OFF;
77 PBIOR |= PBDR_BTN_OFF; 77 PBIOR |= PBDR_BTN_OFF;
78#else 78#else