summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx
diff options
context:
space:
mode:
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;
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++;