diff options
author | William Wilgus <wilgus.william@gmail.com> | 2020-09-17 11:07:29 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2020-09-17 11:22:40 -0400 |
commit | a66b9088014fd77d08c34fc07a4e701051e1525a (patch) | |
tree | 8607b0bd69655e2430a06d6681fe0209b5a332a2 | |
parent | 3c2b6809d94adcb958c135ca471a666c15fd0060 (diff) | |
download | rockbox-a66b9088014fd77d08c34fc07a4e701051e1525a.tar.gz rockbox-a66b9088014fd77d08c34fc07a4e701051e1525a.zip |
Xduoo X3 add headphone and lineout status to IO Ports debug menu
Change-Id: I9caf55c1249625dff7e437158afd20a526fa7499
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/debug-jz4760.c | 43 |
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; | |||
56 | 56 | ||
57 | #define ON "Enabled" | 57 | #define ON "Enabled" |
58 | #define OFF "Disabled" | 58 | #define OFF "Disabled" |
59 | #define INSERTED "Inserted" | ||
60 | #define REMOVED "Removed" | ||
61 | #define OFF "Disabled" | ||
59 | #define STOPPED "Stopped" | 62 | #define STOPPED "Stopped" |
60 | #define RUNNING "Running" | 63 | #define RUNNING "Running" |
61 | 64 | ||
@@ -323,7 +326,6 @@ bool dbg_ports(void) | |||
323 | long fun, intr; | 326 | long fun, intr; |
324 | long lvl; | 327 | long lvl; |
325 | 328 | ||
326 | |||
327 | lcd_clear_display(); | 329 | lcd_clear_display(); |
328 | lcd_setfont(FONT_SYSFIXED); | 330 | lcd_setfont(FONT_SYSFIXED); |
329 | 331 | ||
@@ -332,24 +334,39 @@ bool dbg_ports(void) | |||
332 | i = 0; | 334 | i = 0; |
333 | while(dbg_btn_update(&done, &x)) | 335 | while(dbg_btn_update(&done, &x)) |
334 | { | 336 | { |
335 | i %= last_port; /*PORT: A B C D E F */ | 337 | i %= last_port; /*PORT: A B C D E F HEADPHONE/LINEOUT */ |
338 | |||
336 | while(dbg_btn_update(&done, &x)) | 339 | while(dbg_btn_update(&done, &x)) |
337 | { | 340 | { |
338 | line = 0; | 341 | line = 0; |
342 | |||
339 | lcd_puts(x, line++, "[GPIO Vals and Dirs]"); | 343 | lcd_puts(x, line++, "[GPIO Vals and Dirs]"); |
340 | for (j = i; j < i + 2; j++) | 344 | for (j = i; j < i + 2; j++) |
341 | { | 345 | { |
342 | cur = j % last_port; | 346 | if (j < last_port) |
343 | dir = REG_GPIO_PXDIR(cur); | 347 | { |
344 | data = REG_GPIO_PXDAT(cur); | 348 | cur = j % last_port; |
345 | fun = REG_GPIO_PXFUN(cur); | 349 | dir = REG_GPIO_PXDIR(cur); |
346 | intr = REG_GPIO_PXIM(cur); | 350 | data = REG_GPIO_PXDAT(cur); |
347 | lvl = REG_GPIO_PXPIN(cur); | 351 | fun = REG_GPIO_PXFUN(cur); |
348 | 352 | intr = REG_GPIO_PXIM(cur); | |
349 | lcd_putsf(x, line++, "[%s%c]: %8x", "GPIO", 'A' + cur, lvl); | 353 | lvl = REG_GPIO_PXPIN(cur); |
350 | lcd_putsf(x, line++, "DIR: %8x FUN: %8x", dir, fun); | 354 | |
351 | lcd_putsf(x, line++, "DAT: %8x INT: %8x", data, intr); | 355 | lcd_putsf(x, line++, "[%s%c]: %8x", "GPIO", 'A' + cur, lvl); |
352 | line++; | 356 | lcd_putsf(x, line++, "DIR: %8x FUN: %8x", dir, fun); |
357 | lcd_putsf(x, line++, "DAT: %8x INT: %8x", data, intr); | ||
358 | line++; | ||
359 | } | ||
360 | else | ||
361 | { | ||
362 | lcd_puts(x, line++, "[Headphone Status]"); | ||
363 | #if defined(HAVE_HEADPHONE_DETECTION) | ||
364 | lcd_putsf(x, line++, "HP: %s", headphones_inserted() ? INSERTED:REMOVED); | ||
365 | #endif | ||
366 | #if defined(HAVE_LINEOUT_DETECTION) | ||
367 | lcd_putsf(x, line++, "LO: %s", lineout_inserted() ? INSERTED:REMOVED); | ||
368 | #endif | ||
369 | } | ||
353 | } | 370 | } |
354 | } | 371 | } |
355 | i++; | 372 | i++; |