From 674538fa43af277fd5cd7fde5f3a0d93dbbb9a11 Mon Sep 17 00:00:00 2001 From: jethead71 Date: Sun, 16 Jan 2011 00:21:54 +0000 Subject: [PATCH] Display messages only when entering USB mode in Portal Player bootloader to keep timed-out charger-only connects going into verbose mode. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29060 a1c6a512-1295-4272-9138-f99709370657 --- bootloader/main-pp.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c index 5bf4e4cf4..67c1d765a 100644 --- a/bootloader/main-pp.c +++ b/bootloader/main-pp.c @@ -470,13 +470,6 @@ static int handle_usb(int connect_timeout) usb_init(); usb_start_monitoring(); - /* Switch to verbose mode if not in it so that the status updates - * are shown */ - - /* TODO: Should we forgo any messages except the connect? It might be a - * charger, not a USB host. */ - verbose = true; - printf("USB: Connecting"); if (connect_timeout != TIMEOUT_BLOCK) @@ -489,6 +482,9 @@ static int handle_usb(int connect_timeout) if (ev.id == SYS_USB_CONNECTED) { + /* Switch to verbose mode if not in it so that the status updates + * are shown */ + verbose = true; /* Got the message - wait for disconnect */ printf("Bootloader USB mode"); @@ -501,7 +497,9 @@ static int handle_usb(int connect_timeout) if (connect_timeout != TIMEOUT_BLOCK && TIME_AFTER(current_tick, end_tick)) { - /* Timed out waiting for the connect */ + /* Timed out waiting for the connect - will happen when connected + * to a charger instead of a host port and the charging pin is + * the same as the USB pin */ printf("USB: Timed out"); break; } @@ -598,10 +596,16 @@ void* main(void) btn = button_read_device(); /* Enable bootloader messages if any button is pressed */ +#ifdef HAVE_BOOTLOADER_USB_MODE + lcd_clear_display(); + if (btn) + verbose = true; +#else if (btn) { lcd_clear_display(); verbose = true; } +#endif lcd_setfont(FONT_SYSFIXED); -- 2.11.4.GIT