summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-10-08 10:52:46 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-10-08 10:52:46 +0000
commit91b26f269aa8aa54bc253af92db673a595eadb09 (patch)
tree5f75490349f8049b28625cadc37ba33cbfd17018 /apps/debug_menu.c
parent96d0f05853b0e69ce390be49af60994142c54091 (diff)
downloadrockbox-91b26f269aa8aa54bc253af92db673a595eadb09.zip
rockbox-91b26f269aa8aa54bc253af92db673a595eadb09.tar.gz
rockbox-91b26f269aa8aa54bc253af92db673a595eadb09.tar.bz2
rockbox-91b26f269aa8aa54bc253af92db673a595eadb09.tar.xz
New debug screen - HW info
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2525 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 2a9b898..ed418e7 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -35,6 +35,7 @@
#include "thread.h"
#include "powermgmt.h"
#include "system.h"
+#include "font.h"
/*---------------------------------------------------*/
/* SPECIAL DEBUG STUFF */
@@ -130,6 +131,40 @@ bool dbg_os(void)
#endif
#ifdef HAVE_LCD_BITMAP
+bool dbg_hw_info(void)
+{
+ char buf[32];
+ int button;
+ int usb_polarity;
+ int rom_version = *(unsigned short*)0x20000fe;
+
+ if(PADR & 0x400)
+ usb_polarity = 1;
+ else
+ usb_polarity = 0;
+
+ lcd_setmargins(0, 0);
+ lcd_setfont(FONT_SYSFIXED);
+ lcd_clear_display();
+
+ snprintf(buf, 32, "ROM: %d.%02d", rom_version/100, rom_version%100);
+ lcd_puts(0, 1, buf);
+
+ snprintf(buf, 32, "USB: %s", usb_polarity?"positive":"negative");
+ lcd_puts(0, 2, buf);
+
+ snprintf(buf, 32, "ATA: 0x%x", ata_io_address);
+ lcd_puts(0, 3, buf);
+
+ lcd_update();
+
+ button = button_get(true);
+
+ return false;
+}
+#endif
+
+#ifdef HAVE_LCD_BITMAP
/* Test code!!! */
bool dbg_ports(void)
{
@@ -776,6 +811,7 @@ bool debug_menu(void)
#endif
#ifdef HAVE_LCD_BITMAP
{ "View battery", view_battery },
+ { "View HW info", dbg_hw_info },
#endif
};