Index: apps/debug_menu.c =================================================================== --- apps/debug_menu.c (revision 15964) +++ apps/debug_menu.c (working copy) @@ -92,6 +92,9 @@ #include "debug-target.h" #endif +#include "i2c-pp.h" +#include "as3514.h" + /*---------------------------------------------------*/ /* SPECIAL DEBUG STUFF */ /*---------------------------------------------------*/ @@ -1211,6 +1214,9 @@ lcd_puts(0, line++, buf); snprintf(buf, sizeof(buf), "ADC_VBAT: %4d", adc_read(ADC_VBAT)); lcd_puts(0, line++, buf); + + snprintf(buf, sizeof(buf), "CHARGER: %02X/%02X", i2c_readbyte(AS3514_I2C_ADDR, 0x22), i2c_readbyte(AS3514_I2C_ADDR, 0x25)); + lcd_puts(0, line++, buf); #endif lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) Index: firmware/target/arm/sandisk/adc-target.h =================================================================== --- firmware/target/arm/sandisk/adc-target.h (revision 15964) +++ firmware/target/arm/sandisk/adc-target.h (working copy) @@ -38,6 +38,6 @@ #define ADC_I_MICSUP2 11 /* Current of MicSup2 for remote control detection */ #define ADC_VBAT 12 /* Single cell battery voltage */ -#define ADC_UNREG_POWER ADC_BVDD /* For compatibility */ +#define ADC_UNREG_POWER ADC_RTCSUP /* For compatibility */ #endif Index: firmware/target/arm/sandisk/power-c200_e200.c =================================================================== --- firmware/target/arm/sandisk/power-c200_e200.c (revision 15964) +++ firmware/target/arm/sandisk/power-c200_e200.c (working copy) @@ -24,8 +24,13 @@ #include "tuner.h" #include "as3514.h" +#define CHARGE_CURRENT 300 /* mA, 50 - 400 in steps of 50 */ +#define CHARGE_VOLTAGE 4000 /* mV, 3900 - 4250 in steps of 50 */ + void power_init(void) { + pp_i2c_send(AS3514_I2C_ADDR, 0x22, (((CHARGE_CURRENT - 50) / 50) << 4) | + (((CHARGE_VOLTAGE - 3900) / 50) << 1)); } void power_off(void)