diff options
author | Cástor Muñoz <cmvidal@gmail.com> | 2016-08-12 02:37:45 +0200 |
---|---|---|
committer | Cástor Muñoz <cmvidal@gmail.com> | 2016-08-12 14:17:46 +0200 |
commit | adbd2969e6e6fd584d46ef60a3fa40bf878d7e00 (patch) | |
tree | 628a89d0e63cd338bbd741702c9b36010f679437 /firmware/target/arm/s5l8702/debug-s5l8702.c | |
parent | a25d0c58aa801087e80b479a7f536d519a422891 (diff) | |
download | rockbox-adbd2969e6e6fd584d46ef60a3fa40bf878d7e00.tar.gz rockbox-adbd2969e6e6fd584d46ef60a3fa40bf878d7e00.zip |
iPod Classic: ADC updates
Add code to read USB D+/D- and accessory ADCs, it is shown in HW
debug menu, might be useful in future for RB and/or the bootloader
to identify external USB chargers.
Change-Id: Ia48ca5e06bb7ddc52bb55abedde6734653ce8dba
Diffstat (limited to 'firmware/target/arm/s5l8702/debug-s5l8702.c')
-rw-r--r-- | firmware/target/arm/s5l8702/debug-s5l8702.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/firmware/target/arm/s5l8702/debug-s5l8702.c b/firmware/target/arm/s5l8702/debug-s5l8702.c index a61a728d43..1bf59e94fe 100644 --- a/firmware/target/arm/s5l8702/debug-s5l8702.c +++ b/firmware/target/arm/s5l8702/debug-s5l8702.c | |||
@@ -19,6 +19,7 @@ | |||
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include <stdio.h> | ||
22 | #include <stdbool.h> | 23 | #include <stdbool.h> |
23 | #include "system.h" | 24 | #include "system.h" |
24 | #include "config.h" | 25 | #include "config.h" |
@@ -28,6 +29,7 @@ | |||
28 | #include "font.h" | 29 | #include "font.h" |
29 | #include "storage.h" | 30 | #include "storage.h" |
30 | #include "power.h" | 31 | #include "power.h" |
32 | #include "adc.h" | ||
31 | #include "pmu-target.h" | 33 | #include "pmu-target.h" |
32 | #include "pcm-target.h" | 34 | #include "pcm-target.h" |
33 | #ifdef HAVE_SERIAL | 35 | #ifdef HAVE_SERIAL |
@@ -134,11 +136,19 @@ bool dbg_hw_info(void) | |||
134 | pmu_accessory_present() ? "true" : "false"); | 136 | pmu_accessory_present() ? "true" : "false"); |
135 | #endif | 137 | #endif |
136 | line++; | 138 | line++; |
139 | _DEBUG_PRINTF("ADC:"); | ||
140 | _DEBUG_PRINTF("%s: %d mV", adc_name(ADC_BATTERY), | ||
141 | adc_read_battery_voltage()); | ||
142 | _DEBUG_PRINTF("%s: %d Ohms", adc_name(ADC_ACCESSORY), | ||
143 | adc_read_accessory_resistor()); | ||
144 | _DEBUG_PRINTF("USB D+: %d mV", adc_read_usbdata_voltage(true)); | ||
145 | _DEBUG_PRINTF("USB D-: %d mV", adc_read_usbdata_voltage(false)); | ||
146 | line++; | ||
137 | extern unsigned long i2c_rd_err, i2c_wr_err; | 147 | extern unsigned long i2c_rd_err, i2c_wr_err; |
138 | _DEBUG_PRINTF("i2c rd/wr errors: %lu/%lu", i2c_rd_err, i2c_wr_err); | 148 | _DEBUG_PRINTF("i2c rd/wr errors: %lu/%lu", i2c_rd_err, i2c_wr_err); |
139 | } | 149 | } |
140 | #ifdef UC870X_DEBUG | 150 | #ifdef UC870X_DEBUG |
141 | else if(state==2) | 151 | else if(state==(max_states-1)) |
142 | { | 152 | { |
143 | extern struct uartc_port ser_port; | 153 | extern struct uartc_port ser_port; |
144 | bool opened = !!ser_port.uartc->port_l[ser_port.id]; | 154 | bool opened = !!ser_port.uartc->port_l[ser_port.id]; |