summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-02-11 13:16:09 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-02-11 13:16:09 +0000
commit6805475fb9142187e9d3c505b2fd225c47477873 (patch)
tree2cc387b59bb71fe9d46ba0aa2d9619276fbea238 /apps/debug_menu.c
parentf48ec1f7fca7b0e12cbcbe4de3dbe21ed5a2edfa (diff)
downloadrockbox-6805475fb9142187e9d3c505b2fd225c47477873.zip
rockbox-6805475fb9142187e9d3c505b2fd225c47477873.tar.gz
rockbox-6805475fb9142187e9d3c505b2fd225c47477873.tar.bz2
rockbox-6805475fb9142187e9d3c505b2fd225c47477873.tar.xz
iRiver: Added dbg_ports()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5910 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 97a3f9a..ab1b60a 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -626,6 +626,77 @@ bool dbg_ports(void)
return false;
}
}
+#elif CONFIG_CPU == MCF5249
+ unsigned int gpio_out;
+ unsigned int gpio1_out;
+ unsigned int gpio_read;
+ unsigned int gpio1_read;
+ unsigned int gpio_function;
+ unsigned int gpio1_function;
+ unsigned int gpio_enable;
+ unsigned int gpio1_enable;
+ int adc_buttons, adc_remote, adc_battery;
+ char buf[32];
+ int button;
+ int line;
+
+#ifdef HAVE_LCD_BITMAP
+ lcd_setmargins(0, 0);
+#endif
+ lcd_clear_display();
+ lcd_setfont(FONT_SYSFIXED);
+
+ while(1)
+ {
+ line = 0;
+ gpio_read = GPIO_READ;
+ gpio1_read = GPIO1_READ;
+ gpio_out = GPIO_OUT;
+ gpio1_out = GPIO1_OUT;
+ gpio_function = GPIO_FUNCTION;
+ gpio1_function = GPIO1_FUNCTION;
+ gpio_enable = GPIO_ENABLE;
+ gpio1_enable = GPIO1_ENABLE;
+
+ snprintf(buf, 32, "GPIO_READ: %08x", gpio_read);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "GPIO_OUT: %08x", gpio_out);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "GPIO_FUNCTION: %08x", gpio_function);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "GPIO_ENABLE: %08x", gpio_enable);
+ lcd_puts(0, line++, buf);
+
+ snprintf(buf, 32, "GPIO1_READ: %08x", gpio1_read);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "GPIO1_OUT: %08x", gpio1_out);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "GPIO1_FUNCTION: %08x", gpio1_function);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "GPIO1_ENABLE: %08x", gpio1_enable);
+ lcd_puts(0, line++, buf);
+
+ adc_buttons = adc_read(ADC_BUTTONS);
+ adc_remote = adc_read(ADC_REMOTE);
+ adc_battery = adc_read(ADC_BATTERY);
+
+ snprintf(buf, 32, "ADC_BUTTONS: %02x", adc_buttons);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "ADC_REMOTE: %02x", adc_remote);
+ lcd_puts(0, line++, buf);
+ snprintf(buf, 32, "ADC_BATTERY: %02x", adc_battery);
+ lcd_puts(0, line++, buf);
+
+ lcd_update();
+ button = button_get_w_tmo(HZ/10);
+
+ switch(button)
+ {
+ case SETTINGS_CANCEL:
+ return false;
+ }
+ }
+
#endif /* CONFIG_CPU == SH7034 */
return false;
}
@@ -1678,7 +1749,11 @@ bool debug_menu(void)
static const struct menu_item items[] = {
#if CONFIG_CPU == SH7034
{ "Dump ROM contents", dbg_save_roms },
+#endif
+#if CONFIG_CPU == SH7034 || CONFIG_CPU == MCF5249
{ "View I/O ports", dbg_ports },
+#endif
+#if CONFIG_CPU == SH7034
#ifdef HAVE_LCD_BITMAP
#ifdef HAVE_RTC
{ "View/clr RTC RAM", dbg_rtc },