summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/debug-imx233.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/debug-imx233.c')
-rw-r--r--firmware/target/arm/imx233/debug-imx233.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c
index fd510b77c1..59792c17a8 100644
--- a/firmware/target/arm/imx233/debug-imx233.c
+++ b/firmware/target/arm/imx233/debug-imx233.c
@@ -399,13 +399,25 @@ bool dbg_hw_info_pinctrl(void)
399{ 399{
400 lcd_setfont(FONT_SYSFIXED); 400 lcd_setfont(FONT_SYSFIXED);
401 401
402#ifdef IMX233_PINCTRL_DEBUG
403 unsigned top_user = 0;
404#endif
402 while(1) 405 while(1)
403 { 406 {
404 int button = get_action(CONTEXT_STD, HZ / 10); 407 int button = get_action(CONTEXT_STD, HZ / 10);
405 switch(button) 408 switch(button)
406 { 409 {
407 case ACTION_STD_NEXT: 410 case ACTION_STD_NEXT:
411#ifdef IMX233_PINCTRL_DEBUG
412 top_user++;
413 break;
414#endif
408 case ACTION_STD_PREV: 415 case ACTION_STD_PREV:
416#ifdef IMX233_PINCTRL_DEBUG
417 if(top_user > 0)
418 top_user--;
419 break;
420#endif
409 case ACTION_STD_OK: 421 case ACTION_STD_OK:
410 case ACTION_STD_MENU: 422 case ACTION_STD_MENU:
411 lcd_setfont(FONT_UI); 423 lcd_setfont(FONT_UI);
@@ -418,6 +430,23 @@ bool dbg_hw_info_pinctrl(void)
418 lcd_clear_display(); 430 lcd_clear_display();
419 for(int i = 0; i < 4; i++) 431 for(int i = 0; i < 4; i++)
420 lcd_putsf(0, i, "DIN%d = 0x%08x", i, imx233_get_gpio_input_mask(i, 0xffffffff)); 432 lcd_putsf(0, i, "DIN%d = 0x%08x", i, imx233_get_gpio_input_mask(i, 0xffffffff));
433#ifdef IMX233_PINCTRL_DEBUG
434 unsigned cur_line = 6;
435 unsigned last_line = lcd_getheight() / font_get(lcd_getfont())->height;
436 unsigned cur_idx = 0;
437
438 for(int bank = 0; bank < 4; bank++)
439 for(int pin = 0; pin < 32; pin++)
440 {
441 const char *owner = imx233_pinctrl_get_pin_use(bank, pin);
442 if(owner == NULL)
443 continue;
444 if(cur_idx++ >= top_user && cur_line < last_line)
445 lcd_putsf(0, cur_line++, "B%dP%02d %s", bank, pin, owner);
446 }
447 if(cur_idx < top_user)
448 top_user = cur_idx - 1;
449#endif
421 lcd_update(); 450 lcd_update();
422 yield(); 451 yield();
423 } 452 }