diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-07-13 02:41:45 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-07-13 02:42:17 +0200 |
commit | bbe94e2b246d7bec307df7666416025b42d9a6f7 (patch) | |
tree | 23a5d6016bacc836fc15fbc98b4860ebab2f2c0d /firmware/target/arm/imx233/debug-imx233.c | |
parent | 8c91d05543aebb8de874270f0b770ef3e56b00bb (diff) | |
download | rockbox-bbe94e2b246d7bec307df7666416025b42d9a6f7.tar.gz rockbox-bbe94e2b246d7bec307df7666416025b42d9a6f7.zip |
imx233: fix audio debug screen
Change-Id: Iaadd43a28907ebd425a0b7199f067a4fab8e9653
Diffstat (limited to 'firmware/target/arm/imx233/debug-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/debug-imx233.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c index ebef023c74..58d3082622 100644 --- a/firmware/target/arm/imx233/debug-imx233.c +++ b/firmware/target/arm/imx233/debug-imx233.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "ocotp-imx233.h" | 34 | #include "ocotp-imx233.h" |
35 | #include "pwm-imx233.h" | 35 | #include "pwm-imx233.h" |
36 | #include "emi-imx233.h" | 36 | #include "emi-imx233.h" |
37 | #include "audioin-imx233.h" | ||
37 | #include "audioout-imx233.h" | 38 | #include "audioout-imx233.h" |
38 | #include "string.h" | 39 | #include "string.h" |
39 | #include "stdio.h" | 40 | #include "stdio.h" |
@@ -799,8 +800,10 @@ bool dbg_hw_info_emi(void) | |||
799 | } | 800 | } |
800 | } | 801 | } |
801 | 802 | ||
802 | bool dbg_hw_info_audioout(void) | 803 | bool dbg_hw_info_audio(void) |
803 | { | 804 | { |
805 | static const char *hp_sel[2] = {"DAC", "Line1"}; | ||
806 | static const char *mux_sel[4] = {"Mic", "Line1", "HP", "Line2"}; | ||
804 | lcd_setfont(FONT_SYSFIXED); | 807 | lcd_setfont(FONT_SYSFIXED); |
805 | 808 | ||
806 | while(1) | 809 | while(1) |
@@ -819,21 +822,22 @@ bool dbg_hw_info_audioout(void) | |||
819 | } | 822 | } |
820 | 823 | ||
821 | lcd_clear_display(); | 824 | lcd_clear_display(); |
822 | struct imx233_audioout_info_t info = imx233_audioout_get_info(); | 825 | struct imx233_audioout_info_t out = imx233_audioout_get_info(); |
826 | struct imx233_audioin_info_t in = imx233_audioin_get_info(); | ||
823 | int line = 0; | 827 | int line = 0; |
824 | #define display_sys(sys, name) \ | 828 | #define display_sys(st, sys, name) \ |
825 | if(info.sys) \ | 829 | if(st.sys) \ |
826 | { \ | 830 | { \ |
827 | char buffer[64]; \ | 831 | char buffer[64]; \ |
828 | snprintf(buffer, 64, "%s: ", name); \ | 832 | snprintf(buffer, 64, "%s: ", name); \ |
829 | for(int i = 0; i < 2; i++) \ | 833 | for(int i = 0; i < 2; i++) \ |
830 | { \ | 834 | { \ |
831 | if(info.sys##mute[i]) \ | 835 | if(st.sys##mute[i]) \ |
832 | strcat(buffer, "mute"); \ | 836 | strcat(buffer, "mute"); \ |
833 | else \ | 837 | else \ |
834 | snprintf(buffer + strlen(buffer), 64, "%d.%d", \ | 838 | snprintf(buffer + strlen(buffer), 64, "%d.%d", \ |
835 | /* properly handle negative values ! */ \ | 839 | /* properly handle negative values ! */ \ |
836 | info.sys##vol[i] / 10, (10 + (info.sys##vol[i]) % 10) % 10); \ | 840 | st.sys##vol[i] / 10, (10 + (st.sys##vol[i]) % 10) % 10); \ |
837 | if(i == 0) \ | 841 | if(i == 0) \ |
838 | strcat(buffer, " / "); \ | 842 | strcat(buffer, " / "); \ |
839 | else \ | 843 | else \ |
@@ -843,11 +847,16 @@ bool dbg_hw_info_audioout(void) | |||
843 | } \ | 847 | } \ |
844 | else \ | 848 | else \ |
845 | lcd_putsf(0, line++, "%s: powered down", name); | 849 | lcd_putsf(0, line++, "%s: powered down", name); |
846 | display_sys(dac, "DAC"); | 850 | display_sys(out, dac, "DAC"); |
847 | display_sys(hp, "HP"); | 851 | display_sys(out, hp, "HP"); |
848 | display_sys(spkr, "SPKR"); | 852 | display_sys(out, spkr, "SPKR"); |
853 | display_sys(in, adc, "ADC"); | ||
854 | display_sys(in, mux, "MUX"); | ||
855 | display_sys(in, mic, "MIC"); | ||
849 | #undef display_sys | 856 | #undef display_sys |
850 | lcd_putsf(0, line++, "capless: %d", info.capless); | 857 | lcd_putsf(0, line++, "capless: %d", out.capless); |
858 | lcd_putsf(0, line++, "HP select: %s", hp_sel[out.hpselect]); | ||
859 | lcd_putsf(0, line++, "MUX select: %s / %s", mux_sel[in.muxselect[0]], mux_sel[in.muxselect[1]]); | ||
851 | 860 | ||
852 | lcd_update(); | 861 | lcd_update(); |
853 | yield(); | 862 | yield(); |
@@ -873,7 +882,7 @@ static struct | |||
873 | {"pwm", dbg_hw_info_pwm}, | 882 | {"pwm", dbg_hw_info_pwm}, |
874 | {"usb", dbg_hw_info_usb}, | 883 | {"usb", dbg_hw_info_usb}, |
875 | {"emi", dbg_hw_info_emi}, | 884 | {"emi", dbg_hw_info_emi}, |
876 | {"audioout", dbg_hw_info_audioout}, | 885 | {"audio", dbg_hw_info_audio}, |
877 | {"target", dbg_hw_target_info}, | 886 | {"target", dbg_hw_target_info}, |
878 | }; | 887 | }; |
879 | 888 | ||