diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/screens.c | 71 | ||||
-rw-r--r-- | apps/screens.h | 1 | ||||
-rw-r--r-- | apps/tree.c | 1 | ||||
-rw-r--r-- | apps/wps.c | 5 |
4 files changed, 77 insertions, 1 deletions
diff --git a/apps/screens.c b/apps/screens.c index c990f6d445..6ec0695e24 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -28,14 +28,83 @@ | |||
28 | #include "mpeg.h" | 28 | #include "mpeg.h" |
29 | #include "usb.h" | 29 | #include "usb.h" |
30 | #include "settings.h" | 30 | #include "settings.h" |
31 | #include "status.h" | ||
31 | #include "playlist.h" | 32 | #include "playlist.h" |
32 | 33 | ||
34 | #ifdef HAVE_LCD_BITMAP | ||
35 | #define BMPHEIGHT_usb_logo 32 | ||
36 | #define BMPWIDTH_usb_logo 100 | ||
37 | static unsigned char usb_logo[] = { | ||
38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, | ||
41 | 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | ||
42 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81, | ||
43 | 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, | ||
44 | 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | ||
45 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, | ||
46 | 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
47 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
48 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, | ||
49 | 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c, | ||
50 | 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, | ||
51 | 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, | ||
52 | 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, | ||
53 | 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01, | ||
54 | 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | ||
55 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, | ||
56 | 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, | ||
57 | 0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f, | ||
58 | 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3, | ||
59 | 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02, | ||
60 | 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | ||
61 | 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, | ||
62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||
64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, | ||
65 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, | ||
66 | 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87, | ||
67 | 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0, | ||
68 | 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | ||
69 | 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, | ||
70 | }; | ||
71 | #endif | ||
72 | |||
73 | void usb_display_info(void) | ||
74 | { | ||
75 | lcd_stop_scroll(); | ||
76 | lcd_clear_display(); | ||
77 | |||
78 | #ifdef HAVE_LCD_BITMAP | ||
79 | /* lcd_bitmap() only supports 16 pixels height! */ | ||
80 | lcd_bitmap(usb_logo, 6, 16, | ||
81 | BMPWIDTH_usb_logo, 8, false); | ||
82 | lcd_bitmap(usb_logo+BMPWIDTH_usb_logo, 6, 24, | ||
83 | BMPWIDTH_usb_logo, 8, false); | ||
84 | lcd_bitmap(usb_logo+BMPWIDTH_usb_logo*2, 6, 32, | ||
85 | BMPWIDTH_usb_logo, 8, false); | ||
86 | lcd_bitmap(usb_logo+BMPWIDTH_usb_logo*3, 6, 40, | ||
87 | BMPWIDTH_usb_logo, 8, false); | ||
88 | status_draw(); | ||
89 | lcd_update(); | ||
90 | #else | ||
91 | lcd_puts(0, 0, "[USB Mode]"); | ||
92 | lcd_icon(ICON_PARAM, false); | ||
93 | lcd_icon(ICON_AUDIO, false); | ||
94 | lcd_icon(ICON_USB, true); | ||
95 | #endif | ||
96 | } | ||
97 | |||
33 | void usb_screen(void) | 98 | void usb_screen(void) |
34 | { | 99 | { |
35 | #ifndef SIMULATOR | 100 | #ifndef SIMULATOR |
36 | backlight_on(); | 101 | backlight_on(); |
37 | usb_acknowledge(SYS_USB_CONNECTED_ACK); | 102 | usb_acknowledge(SYS_USB_CONNECTED_ACK); |
38 | usb_wait_for_disconnect(&button_queue); | 103 | while(usb_wait_for_disconnect_w_tmo(&button_queue, HZ)) { |
104 | if(usb_inserted()) { | ||
105 | usb_display_info(); | ||
106 | } | ||
107 | } | ||
39 | backlight_on(); | 108 | backlight_on(); |
40 | #endif | 109 | #endif |
41 | } | 110 | } |
diff --git a/apps/screens.h b/apps/screens.h index 22eebb8053..27b156b895 100644 --- a/apps/screens.h +++ b/apps/screens.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #ifndef _SCREENS_H_ | 19 | #ifndef _SCREENS_H_ |
20 | #define _SCREENS_H_ | 20 | #define _SCREENS_H_ |
21 | 21 | ||
22 | void usb_display_info(void); | ||
22 | void usb_screen(void); | 23 | void usb_screen(void); |
23 | 24 | ||
24 | #ifdef HAVE_RECORDER_KEYPAD | 25 | #ifdef HAVE_RECORDER_KEYPAD |
diff --git a/apps/tree.c b/apps/tree.c index f31811b9a5..5cd803adfe 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1047,6 +1047,7 @@ bool dirbrowse(char *root) | |||
1047 | #endif | 1047 | #endif |
1048 | 1048 | ||
1049 | case SYS_USB_CONNECTED: | 1049 | case SYS_USB_CONNECTED: |
1050 | status_set_playmode(STATUS_STOP); | ||
1050 | usb_screen(); | 1051 | usb_screen(); |
1051 | reload_root = true; | 1052 | reload_root = true; |
1052 | break; | 1053 | break; |
diff --git a/apps/wps.c b/apps/wps.c index e740216d96..82b62ca1b1 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -284,6 +284,7 @@ static int browse_id3(void) | |||
284 | break; | 284 | break; |
285 | 285 | ||
286 | case SYS_USB_CONNECTED: | 286 | case SYS_USB_CONNECTED: |
287 | status_set_playmode(STATUS_STOP); | ||
287 | usb_screen(); | 288 | usb_screen(); |
288 | return SYS_USB_CONNECTED; | 289 | return SYS_USB_CONNECTED; |
289 | break; | 290 | break; |
@@ -397,6 +398,7 @@ static bool ffwd_rew(int button) | |||
397 | break; | 398 | break; |
398 | 399 | ||
399 | case SYS_USB_CONNECTED: | 400 | case SYS_USB_CONNECTED: |
401 | status_set_playmode(STATUS_STOP); | ||
400 | usb_screen(); | 402 | usb_screen(); |
401 | usb = true; | 403 | usb = true; |
402 | exit = true; | 404 | exit = true; |
@@ -482,6 +484,7 @@ static bool keylock(void) | |||
482 | break; | 484 | break; |
483 | 485 | ||
484 | case SYS_USB_CONNECTED: | 486 | case SYS_USB_CONNECTED: |
487 | status_set_playmode(STATUS_STOP); | ||
485 | usb_screen(); | 488 | usb_screen(); |
486 | return true; | 489 | return true; |
487 | 490 | ||
@@ -603,6 +606,7 @@ static bool menu(void) | |||
603 | break; | 606 | break; |
604 | 607 | ||
605 | case SYS_USB_CONNECTED: | 608 | case SYS_USB_CONNECTED: |
609 | status_set_playmode(STATUS_STOP); | ||
606 | usb_screen(); | 610 | usb_screen(); |
607 | return true; | 611 | return true; |
608 | } | 612 | } |
@@ -852,6 +856,7 @@ int wps_show(void) | |||
852 | return 0; | 856 | return 0; |
853 | 857 | ||
854 | case SYS_USB_CONNECTED: | 858 | case SYS_USB_CONNECTED: |
859 | status_set_playmode(STATUS_STOP); | ||
855 | usb_screen(); | 860 | usb_screen(); |
856 | return SYS_USB_CONNECTED; | 861 | return SYS_USB_CONNECTED; |
857 | 862 | ||