summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-10-10 12:01:58 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-10-10 12:01:58 +0000
commit4d55c2f4b7c207d32dc0d6fd055627e08f2b0561 (patch)
tree8a4caa296047120aec60977ebf76580a68f33e7e /apps
parent1a7bc7edeff7a8295b0fdd76458d4ca504adcf6c (diff)
downloadrockbox-4d55c2f4b7c207d32dc0d6fd055627e08f2b0561.zip
rockbox-4d55c2f4b7c207d32dc0d6fd055627e08f2b0561.tar.gz
rockbox-4d55c2f4b7c207d32dc0d6fd055627e08f2b0561.tar.bz2
rockbox-4d55c2f4b7c207d32dc0d6fd055627e08f2b0561.tar.xz
Partition debug screen added, and jumped to when no fat32 partition is found at boot.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2558 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c58
-rw-r--r--apps/debug_menu.h1
-rw-r--r--apps/main.c11
3 files changed, 68 insertions, 2 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 670f965..dca95d6 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -36,6 +36,7 @@
#include "powermgmt.h"
#include "system.h"
#include "font.h"
+#include "disk.h"
/*---------------------------------------------------*/
/* SPECIAL DEBUG STUFF */
@@ -261,6 +262,62 @@ bool dbg_hw_info(void)
}
#endif
+bool dbg_partitions(void)
+{
+ int partition=0;
+
+ lcd_clear_display();
+ lcd_puts(0, 0, "Partition");
+ lcd_puts(0, 1, "list");
+ lcd_update();
+ sleep(HZ);
+
+ while(1)
+ {
+ char buf[32];
+ int button;
+ struct partinfo* p = disk_partinfo(partition);
+
+ lcd_clear_display();
+ snprintf(buf, sizeof buf, "P%d: S:%x", partition, p->start);
+ lcd_puts(0, 0, buf);
+ snprintf(buf, sizeof buf, "T:%x %d MB", p->type, p->size / 2048);
+ lcd_puts(0, 1, buf);
+ lcd_update();
+
+ button = button_get(true);
+
+ switch(button)
+ {
+#ifdef HAVE_RECORDER_KEYPAD
+ case BUTTON_OFF:
+#else
+ case BUTTON_STOP:
+#endif
+ return false;
+
+#ifdef HAVE_RECORDER_KEYPAD
+ case BUTTON_UP:
+#endif
+ case BUTTON_LEFT:
+ partition--;
+ if (partition < 0)
+ partition = 3;
+ break;
+
+#ifdef HAVE_RECORDER_KEYPAD
+ case BUTTON_DOWN:
+#endif
+ case BUTTON_RIGHT:
+ partition++;
+ if (partition > 3)
+ partition = 0;
+ break;
+ }
+ }
+ return false;
+}
+
#ifdef HAVE_LCD_BITMAP
/* Test code!!! */
bool dbg_ports(void)
@@ -910,6 +967,7 @@ bool debug_menu(void)
{ "View battery", view_battery },
#endif
{ "View HW info", dbg_hw_info },
+ { "View partitions", dbg_partitions },
};
m=menu_init( items, sizeof items / sizeof(struct menu_items) );
diff --git a/apps/debug_menu.h b/apps/debug_menu.h
index 9b4841f..4b2c193 100644
--- a/apps/debug_menu.h
+++ b/apps/debug_menu.h
@@ -27,5 +27,6 @@ extern bool dbg_ports(void);
extern bool dbg_rtc(void);
#endif
#endif
+extern bool dbg_partitions(void);
#endif
diff --git a/apps/main.c b/apps/main.c
index dedeea7..30d5f08 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -141,8 +141,15 @@ void init(void)
if ( i==4 ) {
DEBUGF("No partition found, trying to mount sector 0.\n");
rc = fat_mount(0);
- if(rc)
- panicf("No FAT32 partition!");
+ if(rc) {
+ lcd_clear_display();
+ lcd_puts(0,0,"No FAT32");
+ lcd_puts(0,1,"partition!");
+ lcd_update();
+ sleep(HZ);
+ while(1)
+ dbg_partitions();
+ }
}
settings_load();