diff options
-rw-r--r-- | apps/debug_menu.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 2a9b898975..ed418e7667 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include "thread.h" | 35 | #include "thread.h" |
36 | #include "powermgmt.h" | 36 | #include "powermgmt.h" |
37 | #include "system.h" | 37 | #include "system.h" |
38 | #include "font.h" | ||
38 | 39 | ||
39 | /*---------------------------------------------------*/ | 40 | /*---------------------------------------------------*/ |
40 | /* SPECIAL DEBUG STUFF */ | 41 | /* SPECIAL DEBUG STUFF */ |
@@ -130,6 +131,40 @@ bool dbg_os(void) | |||
130 | #endif | 131 | #endif |
131 | 132 | ||
132 | #ifdef HAVE_LCD_BITMAP | 133 | #ifdef HAVE_LCD_BITMAP |
134 | bool dbg_hw_info(void) | ||
135 | { | ||
136 | char buf[32]; | ||
137 | int button; | ||
138 | int usb_polarity; | ||
139 | int rom_version = *(unsigned short*)0x20000fe; | ||
140 | |||
141 | if(PADR & 0x400) | ||
142 | usb_polarity = 1; | ||
143 | else | ||
144 | usb_polarity = 0; | ||
145 | |||
146 | lcd_setmargins(0, 0); | ||
147 | lcd_setfont(FONT_SYSFIXED); | ||
148 | lcd_clear_display(); | ||
149 | |||
150 | snprintf(buf, 32, "ROM: %d.%02d", rom_version/100, rom_version%100); | ||
151 | lcd_puts(0, 1, buf); | ||
152 | |||
153 | snprintf(buf, 32, "USB: %s", usb_polarity?"positive":"negative"); | ||
154 | lcd_puts(0, 2, buf); | ||
155 | |||
156 | snprintf(buf, 32, "ATA: 0x%x", ata_io_address); | ||
157 | lcd_puts(0, 3, buf); | ||
158 | |||
159 | lcd_update(); | ||
160 | |||
161 | button = button_get(true); | ||
162 | |||
163 | return false; | ||
164 | } | ||
165 | #endif | ||
166 | |||
167 | #ifdef HAVE_LCD_BITMAP | ||
133 | /* Test code!!! */ | 168 | /* Test code!!! */ |
134 | bool dbg_ports(void) | 169 | bool dbg_ports(void) |
135 | { | 170 | { |
@@ -776,6 +811,7 @@ bool debug_menu(void) | |||
776 | #endif | 811 | #endif |
777 | #ifdef HAVE_LCD_BITMAP | 812 | #ifdef HAVE_LCD_BITMAP |
778 | { "View battery", view_battery }, | 813 | { "View battery", view_battery }, |
814 | { "View HW info", dbg_hw_info }, | ||
779 | #endif | 815 | #endif |
780 | }; | 816 | }; |
781 | 817 | ||