summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-09-17 11:07:29 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-09-17 11:22:40 -0400
commita66b9088014fd77d08c34fc07a4e701051e1525a (patch)
tree8607b0bd69655e2430a06d6681fe0209b5a332a2 /firmware/target/mips/ingenic_jz47xx
parent3c2b6809d94adcb958c135ca471a666c15fd0060 (diff)
downloadrockbox-a66b9088014fd77d08c34fc07a4e701051e1525a.tar.gz
rockbox-a66b9088014fd77d08c34fc07a4e701051e1525a.zip
Xduoo X3 add headphone and lineout status to IO Ports debug menu
Change-Id: I9caf55c1249625dff7e437158afd20a526fa7499
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/debug-jz4760.c43
1 files changed, 30 insertions, 13 deletions
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++;