diff options
Diffstat (limited to 'apps/main.c')
-rw-r--r-- | apps/main.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/apps/main.c b/apps/main.c index e5349ae4bf..145153ba37 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -142,7 +142,8 @@ int main(void) | |||
142 | list_init(); | 142 | list_init(); |
143 | #endif | 143 | #endif |
144 | tree_gui_init(); | 144 | tree_gui_init(); |
145 | viewportmanager_init(); | 145 | /* Keep the order of this 3 |
146 | * Must be done before any code uses the multi-screen API */ | ||
146 | #ifdef HAVE_USBSTACK | 147 | #ifdef HAVE_USBSTACK |
147 | /* All threads should be created and public queues registered by now */ | 148 | /* All threads should be created and public queues registered by now */ |
148 | usb_start_monitoring(); | 149 | usb_start_monitoring(); |
@@ -318,13 +319,16 @@ static void init(void) | |||
318 | #ifdef DEBUG | 319 | #ifdef DEBUG |
319 | debug_init(); | 320 | debug_init(); |
320 | #endif | 321 | #endif |
321 | /* Must be done before any code uses the multi-screen API */ | 322 | /* Keep the order of this 3 (viewportmanager handles statusbars) |
323 | * Must be done before any code uses the multi-screen API */ | ||
322 | gui_syncstatusbar_init(&statusbars); | 324 | gui_syncstatusbar_init(&statusbars); |
325 | sb_skin_init(); | ||
326 | viewportmanager_init(); | ||
327 | |||
328 | gui_sync_wps_init(); | ||
323 | storage_init(); | 329 | storage_init(); |
324 | settings_reset(); | 330 | settings_reset(); |
325 | settings_load(SETTINGS_ALL); | 331 | settings_load(SETTINGS_ALL); |
326 | gui_sync_wps_init(); | ||
327 | sb_skin_init(); | ||
328 | settings_apply(true); | 332 | settings_apply(true); |
329 | init_dircache(true); | 333 | init_dircache(true); |
330 | init_dircache(false); | 334 | init_dircache(false); |
@@ -443,8 +447,13 @@ static void init(void) | |||
443 | radio_init(); | 447 | radio_init(); |
444 | #endif | 448 | #endif |
445 | 449 | ||
446 | /* Must be done before any code uses the multi-screen API */ | 450 | /* Keep the order of this 3 (viewportmanager handles statusbars) |
451 | * Must be done before any code uses the multi-screen API */ | ||
447 | gui_syncstatusbar_init(&statusbars); | 452 | gui_syncstatusbar_init(&statusbars); |
453 | sb_skin_init(); | ||
454 | viewportmanager_init(); | ||
455 | |||
456 | gui_sync_wps_init(); | ||
448 | 457 | ||
449 | #if CONFIG_CHARGING && (CONFIG_CPU == SH7034) | 458 | #if CONFIG_CHARGING && (CONFIG_CPU == SH7034) |
450 | /* charger_inserted() can't be used here because power_thread() | 459 | /* charger_inserted() can't be used here because power_thread() |
@@ -496,7 +505,7 @@ static void init(void) | |||
496 | (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED)) | 505 | (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED)) |
497 | #endif | 506 | #endif |
498 | { | 507 | { |
499 | gui_usb_screen_run(true); | 508 | gui_usb_screen_run(); |
500 | mounted = true; /* mounting done @ end of USB mode */ | 509 | mounted = true; /* mounting done @ end of USB mode */ |
501 | } | 510 | } |
502 | #ifdef HAVE_USB_POWER | 511 | #ifdef HAVE_USB_POWER |
@@ -521,7 +530,7 @@ static void init(void) | |||
521 | lcd_update(); | 530 | lcd_update(); |
522 | 531 | ||
523 | while(button_get(true) != SYS_USB_CONNECTED) {}; | 532 | while(button_get(true) != SYS_USB_CONNECTED) {}; |
524 | gui_usb_screen_run(true); | 533 | gui_usb_screen_run(); |
525 | system_reboot(); | 534 | system_reboot(); |
526 | } | 535 | } |
527 | } | 536 | } |
@@ -551,8 +560,6 @@ static void init(void) | |||
551 | #endif | 560 | #endif |
552 | } | 561 | } |
553 | 562 | ||
554 | gui_sync_wps_init(); | ||
555 | sb_skin_init(); | ||
556 | settings_apply(true); | 563 | settings_apply(true); |
557 | init_dircache(false); | 564 | init_dircache(false); |
558 | #ifdef HAVE_TAGCACHE | 565 | #ifdef HAVE_TAGCACHE |