From 0449c0ef5d3397ac6944bcb73678e087b7ef0f3e Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Tue, 4 Mar 2008 14:31:14 +0000 Subject: Second part of FS#8272 - include charger status in Sansa debug menu. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16513 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 8 ++++++-- firmware/export/as3514.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/debug_menu.c b/apps/debug_menu.c index f448d30b3c..21ed3e119c 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -97,6 +97,9 @@ #include "debug-target.h" #endif +#include "i2c-pp.h" +#include "as3514.h" + /*---------------------------------------------------*/ /* SPECIAL DEBUG STUFF */ /*---------------------------------------------------*/ @@ -1179,8 +1182,7 @@ bool dbg_ports(void) snprintf(buf, sizeof(buf), "REM: %03x PAD: %03x", adc_read(ADC_REMOTE), adc_read(ADC_SCROLLPAD)); lcd_puts(0, line++, buf); -#elif defined(SANSA_E200) - line++; +#elif defined(SANSA_E200) snprintf(buf, sizeof(buf), "ADC_BVDD: %4d", adc_read(ADC_BVDD)); lcd_puts(0, line++, buf); snprintf(buf, sizeof(buf), "ADC_RTCSUP: %4d", adc_read(ADC_RTCSUP)); @@ -1207,6 +1209,8 @@ bool dbg_ports(void) 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, CHRGR), i2c_readbyte(AS3514_I2C_ADDR, IRQ_ENRD0)); + lcd_puts(0, line++, buf); #endif lcd_update(); if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h index 999563d33c..a1c061905d 100644 --- a/firmware/export/as3514.h +++ b/firmware/export/as3514.h @@ -53,6 +53,7 @@ extern void audiohw_set_sample_rate(int sampling_control); #define PLLMODE 0x1d #define SYSTEM 0x20 +#define CHRGR 0x22 #define DCDC15 0x23 #define SUPERVISOR 0x24 -- cgit v1.2.3