From b81a3c54a49a7adac76236f06a1b9327aac85cba Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 25 Mar 2004 12:29:34 +0000 Subject: We now start monitoring USB earlier, and can enter USB mode from the debug partition viewer. This fixes bug #799491. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4438 a1c6a512-1295-4272-9138-f99709370657 --- apps/debug_menu.c | 5 +++++ apps/main.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 73c653af75..7739915162 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -45,6 +45,7 @@ #include "fat.h" #include "dir.h" #include "panic.h" +#include "screens.h" #ifdef HAVE_LCD_BITMAP #include "widgets.h" #include "peakmeter.h" @@ -504,6 +505,10 @@ bool dbg_partitions(void) if (partition > 3) partition = 0; break; + + case SYS_USB_CONNECTED: + usb_screen(); + return true; } } return false; diff --git a/apps/main.c b/apps/main.c index 2c2f9ac854..7fdd30b654 100644 --- a/apps/main.c +++ b/apps/main.c @@ -153,6 +153,8 @@ void init(void) (void)coldstart; #endif + usb_start_monitoring(); + rc = ata_init(); if(rc) { @@ -177,6 +179,7 @@ void init(void) if (!fat_mount(pinfo[i].start)) break; } + if ( i==4 ) { DEBUGF("No partition found, trying to mount sector 0.\n"); rc = fat_mount(0); @@ -186,15 +189,16 @@ void init(void) lcd_puts(0,1,"partition!"); lcd_update(); sleep(HZ); - while(1) - dbg_partitions(); + /* Don't leave until we have been in USB mode */ + while(!dbg_partitions()); + + /* The USB thread will panic if the drive still can't be mounted */ } } settings_load(); status_init(); - usb_start_monitoring(); playlist_init(); tree_init(); -- cgit