diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-09-11 09:06:58 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-09-11 09:06:58 +0000 |
commit | 00be7469d6bd0810cfa65f4b935da5db6fac09d4 (patch) | |
tree | bf7b43a7c188906eec01d499a9f597dc6001e854 /firmware | |
parent | 57ea92cae1f4d0f28b453e0caf68977c599cc096 (diff) | |
download | rockbox-00be7469d6bd0810cfa65f4b935da5db6fac09d4.tar.gz rockbox-00be7469d6bd0810cfa65f4b935da5db6fac09d4.zip |
prepared Ondio USB passthrough (but doesn't work yet)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5066 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/ata.c | 2 | ||||
-rw-r--r-- | firmware/drivers/ata_mmc.c | 19 | ||||
-rw-r--r-- | firmware/export/adc.h | 3 | ||||
-rw-r--r-- | firmware/usb.c | 4 |
4 files changed, 21 insertions, 7 deletions
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 21d97aa939..af6955b2b0 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c | |||
@@ -1174,4 +1174,4 @@ int ata_init(void) | |||
1174 | return 0; | 1174 | return 0; |
1175 | } | 1175 | } |
1176 | 1176 | ||
1177 | #endif /* #ifndef HAVE_MMC */ \ No newline at end of file | 1177 | #endif /* #ifndef HAVE_MMC */ |
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c index a3669573e0..7ce1547085 100644 --- a/firmware/drivers/ata_mmc.c +++ b/firmware/drivers/ata_mmc.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "power.h" | 29 | #include "power.h" |
30 | #include "string.h" | 30 | #include "string.h" |
31 | #include "hwcompat.h" | 31 | #include "hwcompat.h" |
32 | #include "adc.h" | ||
32 | 33 | ||
33 | /* use file for an MMC-based system, FIXME in makefile */ | 34 | /* use file for an MMC-based system, FIXME in makefile */ |
34 | #ifdef HAVE_MMC | 35 | #ifdef HAVE_MMC |
@@ -257,9 +258,23 @@ int ata_init(void) | |||
257 | 258 | ||
258 | led(false); | 259 | led(false); |
259 | 260 | ||
260 | /* ToDo: Port setup */ | 261 | /* Port setup */ |
261 | // PAIOR |= 0x1680; | 262 | PADR |= 0x1600; /* set all the selects high (=inactive) */ |
263 | PAIOR |= 0x1600; /* make outputs for them */ | ||
264 | PAIOR &= ~0x0008; /* input for card detect */ | ||
262 | 265 | ||
266 | /* serial setup */ | ||
267 | PBCR1 &= ~0x0CF0; /* use PB10, PB11, PB13 */ | ||
268 | PBCR1 |= 0x08A0; /* as RxD1, TxD1, SCK1 */ | ||
269 | |||
270 | if(adc_read(ADC_MMC_SWITCH) < 0x200) | ||
271 | { /* MMC inserted */ | ||
272 | PADR |= 0x0200; | ||
273 | } | ||
274 | else | ||
275 | { /* no MMC, use internal memory */ | ||
276 | PADR |= 0x0400; | ||
277 | } | ||
263 | 278 | ||
264 | sleeping = false; | 279 | sleeping = false; |
265 | ata_enable(true); | 280 | ata_enable(true); |
diff --git a/firmware/export/adc.h b/firmware/export/adc.h index cbc40e2662..966714cbbd 100644 --- a/firmware/export/adc.h +++ b/firmware/export/adc.h | |||
@@ -23,8 +23,7 @@ | |||
23 | 23 | ||
24 | #ifdef HAVE_ONDIO_ADC | 24 | #ifdef HAVE_ONDIO_ADC |
25 | 25 | ||
26 | #define ADC_MMC_SWITCH 0 /* Battery voltage always reads 0x3FF due to | 26 | #define ADC_MMC_SWITCH 0 /* low values if MMC inserted */ |
27 | silly scaling */ | ||
28 | #define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */ | 27 | #define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */ |
29 | #define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */ | 28 | #define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */ |
30 | #define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */ | 29 | #define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */ |
diff --git a/firmware/usb.c b/firmware/usb.c index 1b9e747dc9..6b226bd43b 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -84,9 +84,9 @@ static void usb_enable(bool on) | |||
84 | } | 84 | } |
85 | else | 85 | else |
86 | { | 86 | { |
87 | and_b(~0x20, &PADRL); | 87 | and_b(~0x20, &PADRL); /* disable USB */ |
88 | } | 88 | } |
89 | or_b(0x20, &PAIORL); | 89 | or_b(0x20, &PAIORL); /* output for USB enable */ |
90 | #else /* standard HD Jukebox */ | 90 | #else /* standard HD Jukebox */ |
91 | if(on) | 91 | if(on) |
92 | { | 92 | { |