From a66b9088014fd77d08c34fc07a4e701051e1525a Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 17 Sep 2020 11:07:29 -0400 Subject: Xduoo X3 add headphone and lineout status to IO Ports debug menu Change-Id: I9caf55c1249625dff7e437158afd20a526fa7499 --- firmware/target/mips/ingenic_jz47xx/debug-jz4760.c | 43 +++++++++++++++------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'firmware') diff --git a/firmware/target/mips/ingenic_jz47xx/debug-jz4760.c b/firmware/target/mips/ingenic_jz47xx/debug-jz4760.c index 567c1798c7..65b5e93887 100644 --- a/firmware/target/mips/ingenic_jz47xx/debug-jz4760.c +++ b/firmware/target/mips/ingenic_jz47xx/debug-jz4760.c @@ -56,6 +56,9 @@ static int maxlines = 0; #define ON "Enabled" #define OFF "Disabled" +#define INSERTED "Inserted" +#define REMOVED "Removed" +#define OFF "Disabled" #define STOPPED "Stopped" #define RUNNING "Running" @@ -323,7 +326,6 @@ bool dbg_ports(void) long fun, intr; long lvl; - lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -332,24 +334,39 @@ bool dbg_ports(void) i = 0; while(dbg_btn_update(&done, &x)) { - i %= last_port; /*PORT: A B C D E F */ + i %= last_port; /*PORT: A B C D E F HEADPHONE/LINEOUT */ + while(dbg_btn_update(&done, &x)) { line = 0; + lcd_puts(x, line++, "[GPIO Vals and Dirs]"); for (j = i; j < i + 2; j++) { - cur = j % last_port; - dir = REG_GPIO_PXDIR(cur); - data = REG_GPIO_PXDAT(cur); - fun = REG_GPIO_PXFUN(cur); - intr = REG_GPIO_PXIM(cur); - lvl = REG_GPIO_PXPIN(cur); - - lcd_putsf(x, line++, "[%s%c]: %8x", "GPIO", 'A' + cur, lvl); - lcd_putsf(x, line++, "DIR: %8x FUN: %8x", dir, fun); - lcd_putsf(x, line++, "DAT: %8x INT: %8x", data, intr); - line++; + if (j < last_port) + { + cur = j % last_port; + dir = REG_GPIO_PXDIR(cur); + data = REG_GPIO_PXDAT(cur); + fun = REG_GPIO_PXFUN(cur); + intr = REG_GPIO_PXIM(cur); + lvl = REG_GPIO_PXPIN(cur); + + lcd_putsf(x, line++, "[%s%c]: %8x", "GPIO", 'A' + cur, lvl); + lcd_putsf(x, line++, "DIR: %8x FUN: %8x", dir, fun); + lcd_putsf(x, line++, "DAT: %8x INT: %8x", data, intr); + line++; + } + else + { + lcd_puts(x, line++, "[Headphone Status]"); +#if defined(HAVE_HEADPHONE_DETECTION) + lcd_putsf(x, line++, "HP: %s", headphones_inserted() ? INSERTED:REMOVED); +#endif +#if defined(HAVE_LINEOUT_DETECTION) + lcd_putsf(x, line++, "LO: %s", lineout_inserted() ? INSERTED:REMOVED); +#endif + } } } i++; -- cgit