diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-02-11 13:16:09 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-02-11 13:16:09 +0000 |
commit | 6805475fb9142187e9d3c505b2fd225c47477873 (patch) | |
tree | 2cc387b59bb71fe9d46ba0aa2d9619276fbea238 | |
parent | f48ec1f7fca7b0e12cbcbe4de3dbe21ed5a2edfa (diff) | |
download | rockbox-6805475fb9142187e9d3c505b2fd225c47477873.tar.gz rockbox-6805475fb9142187e9d3c505b2fd225c47477873.zip |
iRiver: Added dbg_ports()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5910 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/debug_menu.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 97a3f9a9f4..ab1b60aaac 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -626,6 +626,77 @@ bool dbg_ports(void) | |||
626 | return false; | 626 | return false; |
627 | } | 627 | } |
628 | } | 628 | } |
629 | #elif CONFIG_CPU == MCF5249 | ||
630 | unsigned int gpio_out; | ||
631 | unsigned int gpio1_out; | ||
632 | unsigned int gpio_read; | ||
633 | unsigned int gpio1_read; | ||
634 | unsigned int gpio_function; | ||
635 | unsigned int gpio1_function; | ||
636 | unsigned int gpio_enable; | ||
637 | unsigned int gpio1_enable; | ||
638 | int adc_buttons, adc_remote, adc_battery; | ||
639 | char buf[32]; | ||
640 | int button; | ||
641 | int line; | ||
642 | |||
643 | #ifdef HAVE_LCD_BITMAP | ||
644 | lcd_setmargins(0, 0); | ||
645 | #endif | ||
646 | lcd_clear_display(); | ||
647 | lcd_setfont(FONT_SYSFIXED); | ||
648 | |||
649 | while(1) | ||
650 | { | ||
651 | line = 0; | ||
652 | gpio_read = GPIO_READ; | ||
653 | gpio1_read = GPIO1_READ; | ||
654 | gpio_out = GPIO_OUT; | ||
655 | gpio1_out = GPIO1_OUT; | ||
656 | gpio_function = GPIO_FUNCTION; | ||
657 | gpio1_function = GPIO1_FUNCTION; | ||
658 | gpio_enable = GPIO_ENABLE; | ||
659 | gpio1_enable = GPIO1_ENABLE; | ||
660 | |||
661 | snprintf(buf, 32, "GPIO_READ: %08x", gpio_read); | ||
662 | lcd_puts(0, line++, buf); | ||
663 | snprintf(buf, 32, "GPIO_OUT: %08x", gpio_out); | ||
664 | lcd_puts(0, line++, buf); | ||
665 | snprintf(buf, 32, "GPIO_FUNCTION: %08x", gpio_function); | ||
666 | lcd_puts(0, line++, buf); | ||
667 | snprintf(buf, 32, "GPIO_ENABLE: %08x", gpio_enable); | ||
668 | lcd_puts(0, line++, buf); | ||
669 | |||
670 | snprintf(buf, 32, "GPIO1_READ: %08x", gpio1_read); | ||
671 | lcd_puts(0, line++, buf); | ||
672 | snprintf(buf, 32, "GPIO1_OUT: %08x", gpio1_out); | ||
673 | lcd_puts(0, line++, buf); | ||
674 | snprintf(buf, 32, "GPIO1_FUNCTION: %08x", gpio1_function); | ||
675 | lcd_puts(0, line++, buf); | ||
676 | snprintf(buf, 32, "GPIO1_ENABLE: %08x", gpio1_enable); | ||
677 | lcd_puts(0, line++, buf); | ||
678 | |||
679 | adc_buttons = adc_read(ADC_BUTTONS); | ||
680 | adc_remote = adc_read(ADC_REMOTE); | ||
681 | adc_battery = adc_read(ADC_BATTERY); | ||
682 | |||
683 | snprintf(buf, 32, "ADC_BUTTONS: %02x", adc_buttons); | ||
684 | lcd_puts(0, line++, buf); | ||
685 | snprintf(buf, 32, "ADC_REMOTE: %02x", adc_remote); | ||
686 | lcd_puts(0, line++, buf); | ||
687 | snprintf(buf, 32, "ADC_BATTERY: %02x", adc_battery); | ||
688 | lcd_puts(0, line++, buf); | ||
689 | |||
690 | lcd_update(); | ||
691 | button = button_get_w_tmo(HZ/10); | ||
692 | |||
693 | switch(button) | ||
694 | { | ||
695 | case SETTINGS_CANCEL: | ||
696 | return false; | ||
697 | } | ||
698 | } | ||
699 | |||
629 | #endif /* CONFIG_CPU == SH7034 */ | 700 | #endif /* CONFIG_CPU == SH7034 */ |
630 | return false; | 701 | return false; |
631 | } | 702 | } |
@@ -1678,7 +1749,11 @@ bool debug_menu(void) | |||
1678 | static const struct menu_item items[] = { | 1749 | static const struct menu_item items[] = { |
1679 | #if CONFIG_CPU == SH7034 | 1750 | #if CONFIG_CPU == SH7034 |
1680 | { "Dump ROM contents", dbg_save_roms }, | 1751 | { "Dump ROM contents", dbg_save_roms }, |
1752 | #endif | ||
1753 | #if CONFIG_CPU == SH7034 || CONFIG_CPU == MCF5249 | ||
1681 | { "View I/O ports", dbg_ports }, | 1754 | { "View I/O ports", dbg_ports }, |
1755 | #endif | ||
1756 | #if CONFIG_CPU == SH7034 | ||
1682 | #ifdef HAVE_LCD_BITMAP | 1757 | #ifdef HAVE_LCD_BITMAP |
1683 | #ifdef HAVE_RTC | 1758 | #ifdef HAVE_RTC |
1684 | { "View/clr RTC RAM", dbg_rtc }, | 1759 | { "View/clr RTC RAM", dbg_rtc }, |