forked from len0rd/rockbox
prepared Ondio USB passthrough (but doesn't work yet)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5066 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
57ea92cae1
commit
00be7469d6
4 changed files with 21 additions and 7 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include "power.h"
|
#include "power.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "hwcompat.h"
|
#include "hwcompat.h"
|
||||||
|
#include "adc.h"
|
||||||
|
|
||||||
/* use file for an MMC-based system, FIXME in makefile */
|
/* use file for an MMC-based system, FIXME in makefile */
|
||||||
#ifdef HAVE_MMC
|
#ifdef HAVE_MMC
|
||||||
|
@ -257,9 +258,23 @@ int ata_init(void)
|
||||||
|
|
||||||
led(false);
|
led(false);
|
||||||
|
|
||||||
/* ToDo: Port setup */
|
/* Port setup */
|
||||||
// PAIOR |= 0x1680;
|
PADR |= 0x1600; /* set all the selects high (=inactive) */
|
||||||
|
PAIOR |= 0x1600; /* make outputs for them */
|
||||||
|
PAIOR &= ~0x0008; /* input for card detect */
|
||||||
|
|
||||||
|
/* serial setup */
|
||||||
|
PBCR1 &= ~0x0CF0; /* use PB10, PB11, PB13 */
|
||||||
|
PBCR1 |= 0x08A0; /* as RxD1, TxD1, SCK1 */
|
||||||
|
|
||||||
|
if(adc_read(ADC_MMC_SWITCH) < 0x200)
|
||||||
|
{ /* MMC inserted */
|
||||||
|
PADR |= 0x0200;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{ /* no MMC, use internal memory */
|
||||||
|
PADR |= 0x0400;
|
||||||
|
}
|
||||||
|
|
||||||
sleeping = false;
|
sleeping = false;
|
||||||
ata_enable(true);
|
ata_enable(true);
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
|
|
||||||
#ifdef HAVE_ONDIO_ADC
|
#ifdef HAVE_ONDIO_ADC
|
||||||
|
|
||||||
#define ADC_MMC_SWITCH 0 /* Battery voltage always reads 0x3FF due to
|
#define ADC_MMC_SWITCH 0 /* low values if MMC inserted */
|
||||||
silly scaling */
|
|
||||||
#define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */
|
#define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */
|
||||||
#define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */
|
#define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */
|
||||||
#define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */
|
#define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */
|
||||||
|
|
|
@ -84,9 +84,9 @@ static void usb_enable(bool on)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
and_b(~0x20, &PADRL);
|
and_b(~0x20, &PADRL); /* disable USB */
|
||||||
}
|
}
|
||||||
or_b(0x20, &PAIORL);
|
or_b(0x20, &PAIORL); /* output for USB enable */
|
||||||
#else /* standard HD Jukebox */
|
#else /* standard HD Jukebox */
|
||||||
if(on)
|
if(on)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue