summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/usb_screen.c27
-rw-r--r--apps/gui/usb_screen.h2
-rw-r--r--apps/main.c4
-rw-r--r--apps/misc.c2
4 files changed, 21 insertions, 14 deletions
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 50188274d2..454570bc3f 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -128,7 +128,7 @@ struct usb_screen_vps_t
#ifdef HAVE_LCD_BITMAP
static void usb_screen_fix_viewports(struct screen *screen,
- struct usb_screen_vps_t *usb_screen_vps)
+ struct usb_screen_vps_t *usb_screen_vps, bool early_usb)
{
int logo_width, logo_height;
struct viewport *parent = &usb_screen_vps->parent;
@@ -147,10 +147,15 @@ static void usb_screen_fix_viewports(struct screen *screen,
logo_height = BMPHEIGHT_usblogo;
}
- viewport_set_defaults(parent, screen->screen_type);
- if (parent->width < logo_width || parent->height < logo_height)
+ if (!early_usb)
+ {
+ viewport_set_defaults(parent, screen->screen_type);
+ if (parent->width < logo_width || parent->height < logo_height)
+ viewport_set_fullscreen(parent, screen->screen_type);
+ }
+ else
viewport_set_fullscreen(parent, screen->screen_type);
-
+
*logo = *parent;
logo->x = parent->width - logo_width;
logo->y = (parent->height - logo_height) / 2;
@@ -242,10 +247,10 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
viewportmanager_set_statusbar(usb_bars);
}
-void gui_usb_screen_run(void)
+void gui_usb_screen_run(bool early_usb)
{
int i;
- int old_bars = viewportmanager_get_statusbar();
+ int old_bars = early_usb ? 0 : viewportmanager_get_statusbar();
struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS];
#if defined HAVE_TOUCHSCREEN
enum touchscreen_mode old_mode = touchscreen_get_mode();
@@ -270,7 +275,7 @@ void gui_usb_screen_run(void)
screen->set_viewport(NULL);
#ifdef HAVE_LCD_BITMAP
- usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]);
+ usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i], early_usb);
#endif
}
@@ -318,9 +323,11 @@ void gui_usb_screen_run(void)
{
screens[i].backlight_on();
}
- viewportmanager_set_statusbar(old_bars);
- send_event(GUI_EVENT_REFRESH, NULL);
-
+ if (!early_usb)
+ {
+ viewportmanager_set_statusbar(old_bars);
+ send_event(GUI_EVENT_REFRESH, NULL);
+ }
}
#endif /* !defined(USB_NONE) */
diff --git a/apps/gui/usb_screen.h b/apps/gui/usb_screen.h
index d601546520..cbf4d296a5 100644
--- a/apps/gui/usb_screen.h
+++ b/apps/gui/usb_screen.h
@@ -21,7 +21,7 @@
#ifndef _USB_SCREEN_H_
#define _USB_SCREEN_H_
-extern void gui_usb_screen_run(void);
+extern void gui_usb_screen_run(bool early_usb);
#endif
diff --git a/apps/main.c b/apps/main.c
index 1eed068f14..e5349ae4bf 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -496,7 +496,7 @@ static void init(void)
(mmc_remove_request() == SYS_HOTSWAP_EXTRACTED))
#endif
{
- gui_usb_screen_run();
+ gui_usb_screen_run(true);
mounted = true; /* mounting done @ end of USB mode */
}
#ifdef HAVE_USB_POWER
@@ -521,7 +521,7 @@ static void init(void)
lcd_update();
while(button_get(true) != SYS_USB_CONNECTED) {};
- gui_usb_screen_run();
+ gui_usb_screen_run(true);
system_reboot();
}
}
diff --git a/apps/misc.c b/apps/misc.c
index f1c38f376c..9e5fb4068d 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -581,7 +581,7 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
check_bootfile(false); /* gets initial size */
#endif
#endif
- gui_usb_screen_run();
+ gui_usb_screen_run(false);
#ifdef BOOTFILE
#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF)
check_bootfile(true);