ipod nano 1g: enable readout of battery current through ADC channel 4066_ISTAT
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30204 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
10a1e8a609
commit
0157c62418
4 changed files with 4 additions and 4 deletions
|
@ -889,10 +889,10 @@ static bool view_battery(void)
|
|||
if(probed_ramsize == 64)
|
||||
x = (adc_read(ADC_4066_ISTAT) * 2400) / (1024 * 2);
|
||||
else
|
||||
#endif
|
||||
x = (adc_read(ADC_4066_ISTAT) * 2400) / (1024 * 3);
|
||||
lcd_putsf(0, 8, "Ibat: %d mA", x);
|
||||
lcd_putsf(0, 9, "Vbat * Ibat: %d mW", x * y / 1000);
|
||||
#endif
|
||||
#elif defined TOSHIBA_GIGABEAT_S
|
||||
int line = 3;
|
||||
unsigned int st;
|
||||
|
|
|
@ -124,7 +124,7 @@ bool dbg_ports(void)
|
|||
#ifdef ADC_ACCESSORY
|
||||
lcd_putsf(0, line++, "ACCESSORY: %d", adc_read(ADC_ACCESSORY));
|
||||
#endif
|
||||
#ifdef IPOD_VIDEO
|
||||
#if defined(IPOD_VIDEO) || defined(IPOD_NANO)
|
||||
lcd_putsf(0, line++, "4066_ISTAT: %d", adc_read(ADC_4066_ISTAT));
|
||||
#endif
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ void adc_init(void)
|
|||
adc_battery->timeout = 0;
|
||||
adcdata[ADC_ACCESSORY].channelnum = 4;
|
||||
adcdata[ADC_ACCESSORY].timeout = 0;
|
||||
#ifdef IPOD_VIDEO
|
||||
#if defined(IPOD_VIDEO) || defined(IPOD_NANO)
|
||||
adcdata[ADC_4066_ISTAT].channelnum = 7;
|
||||
adcdata[ADC_4066_ISTAT].timeout = 0;
|
||||
#endif
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#define ADC_BATTERY 0
|
||||
#define ADC_ACCESSORY 1
|
||||
#define ADC_UNREG_POWER ADC_BATTERY
|
||||
#ifdef IPOD_VIDEO
|
||||
#if defined(IPOD_VIDEO) || defined(IPOD_NANO)
|
||||
#define ADC_4066_ISTAT 2
|
||||
#define NUM_ADC_CHANNELS 3
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue