summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 670f965eb2..dca95d6cf7 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -36,6 +36,7 @@
36#include "powermgmt.h" 36#include "powermgmt.h"
37#include "system.h" 37#include "system.h"
38#include "font.h" 38#include "font.h"
39#include "disk.h"
39 40
40/*---------------------------------------------------*/ 41/*---------------------------------------------------*/
41/* SPECIAL DEBUG STUFF */ 42/* SPECIAL DEBUG STUFF */
@@ -261,6 +262,62 @@ bool dbg_hw_info(void)
261} 262}
262#endif 263#endif
263 264
265bool dbg_partitions(void)
266{
267 int partition=0;
268
269 lcd_clear_display();
270 lcd_puts(0, 0, "Partition");
271 lcd_puts(0, 1, "list");
272 lcd_update();
273 sleep(HZ);
274
275 while(1)
276 {
277 char buf[32];
278 int button;
279 struct partinfo* p = disk_partinfo(partition);
280
281 lcd_clear_display();
282 snprintf(buf, sizeof buf, "P%d: S:%x", partition, p->start);
283 lcd_puts(0, 0, buf);
284 snprintf(buf, sizeof buf, "T:%x %d MB", p->type, p->size / 2048);
285 lcd_puts(0, 1, buf);
286 lcd_update();
287
288 button = button_get(true);
289
290 switch(button)
291 {
292#ifdef HAVE_RECORDER_KEYPAD
293 case BUTTON_OFF:
294#else
295 case BUTTON_STOP:
296#endif
297 return false;
298
299#ifdef HAVE_RECORDER_KEYPAD
300 case BUTTON_UP:
301#endif
302 case BUTTON_LEFT:
303 partition--;
304 if (partition < 0)
305 partition = 3;
306 break;
307
308#ifdef HAVE_RECORDER_KEYPAD
309 case BUTTON_DOWN:
310#endif
311 case BUTTON_RIGHT:
312 partition++;
313 if (partition > 3)
314 partition = 0;
315 break;
316 }
317 }
318 return false;
319}
320
264#ifdef HAVE_LCD_BITMAP 321#ifdef HAVE_LCD_BITMAP
265/* Test code!!! */ 322/* Test code!!! */
266bool dbg_ports(void) 323bool dbg_ports(void)
@@ -910,6 +967,7 @@ bool debug_menu(void)
910 { "View battery", view_battery }, 967 { "View battery", view_battery },
911#endif 968#endif
912 { "View HW info", dbg_hw_info }, 969 { "View HW info", dbg_hw_info },
970 { "View partitions", dbg_partitions },
913 }; 971 };
914 972
915 m=menu_init( items, sizeof items / sizeof(struct menu_items) ); 973 m=menu_init( items, sizeof items / sizeof(struct menu_items) );