lib: tizen: thor screen update
authorPrzemyslaw Marczak <p.marczak@samsung.com>
Wed, 2 Apr 2014 14:13:59 +0000 (16:13 +0200)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Thu, 15 Jan 2015 06:35:38 +0000 (15:35 +0900)
Now cable connection message is displayed on thor screen.
When cable is connected then only unneeded lcd console lines are overwritten.

Main changes:
- add new function: draw_thor_connected()
- update function draw_thor_screen()
- usb: gadget: thor:
  - move call to draw_thor_screen(),
  - add call to draw_thor_connected()

other change:
- remove draw_thor_init_screen() function

Change-Id: Ifc33f63eeb4822551fc78af1c6dd2a03044cab7e
Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com>
drivers/usb/gadget/f_thor.c
include/libtizen.h
lib/tizen/tizen.c

index 21c93c9..c490463 100644 (file)
@@ -712,7 +712,7 @@ int thor_init(void)
        int power_key_cnt = 0;
 
 #ifdef CONFIG_TIZEN
-       draw_thor_init_screen();
+       draw_thor_screen();
 #endif
        /* Wait for a device enumeration and configuration settings */
        debug("THOR enumeration/configuration setting....\n");
@@ -729,7 +729,7 @@ int thor_init(void)
                }
        }
 #ifdef CONFIG_TIZEN
-       draw_thor_screen();
+       draw_thor_connected();
 #endif
        thor_set_dma(thor_rx_data_buf, strlen("THOR"));
        /* detect the download request from Host PC */
index 3d31d22..fb47b26 100644 (file)
@@ -14,8 +14,8 @@
 
 void get_tizen_logo_info(vidinfo_t *vid);
 void draw_thor_progress(unsigned long long int total_file_size, unsigned long long int downloaded_file_size);
-void draw_thor_init_screen(void);
 void draw_thor_screen(void);
+void draw_thor_connected(void);
 void draw_thor_fail_screen(void);
 void draw_thor_cable_info(void);
 
index 48a5708..53ee77b 100644 (file)
@@ -62,11 +62,25 @@ void draw_thor_fail_screen(void)
        bmp_display((unsigned long)download_fail_text, x, y);
 }
 
-void draw_thor_init_screen(void)
+static unsigned int tmp_msg_x, tmp_msg_y;
+
+void draw_thor_connected(void)
 {
-       lcd_clear();
-       lcd_printf("\n\n\tConnect USB cable for start THOR.");
-       lcd_printf("\n\n\tFor EXIT press POWERKEY 3 times.\n");
+       unsigned int prev_console_x, prev_console_y;
+
+       /* Get curent lcd xy */
+       lcd_get_position_cursor(&prev_console_x, &prev_console_y);
+
+       /* Set proper lcd xy position for clean unneeded messages */
+       lcd_set_position_cursor(tmp_msg_x, tmp_msg_y);
+       lcd_puts("\n\n                                          ");
+       lcd_puts("\n\n                                          ");
+
+       lcd_set_position_cursor(tmp_msg_x, tmp_msg_y);
+       lcd_printf("\n\n\tConnection established.");
+
+       /* Restore last lcd x y position */
+       lcd_set_position_cursor(prev_console_x, prev_console_y);
 }
 
 void draw_thor_screen(void)
@@ -74,6 +88,22 @@ void draw_thor_screen(void)
        int x, y;
 
        lcd_clear();
+       lcd_printf("\n\n\tTHOR Tizen Downloader");
+
+       lcd_printf("\n\n\tU-BOOT bootloader info:");
+       lcd_printf("\n\tCompilation date: %s\n\tBinary version: %s\n",
+                  U_BOOT_DATE, PLAIN_VERSION);
+
+       char *pit_compatible = getenv("dfu_alt_pit_compatible");
+       if (pit_compatible) {
+               lcd_printf("\tPlatform compatible with PIT Version: %s\n",
+                          pit_compatible);
+       };
+
+       lcd_get_position_cursor(&tmp_msg_x, &tmp_msg_y);
+
+       lcd_printf("\n\n\tPlease connect USB cable.");
+       lcd_printf("\n\n\tFor EXIT press POWERKEY 3 times.\n");
 
        x = 199 + LOGO_X_OFS;
        y = 272 + LOGO_Y_OFS;
@@ -90,15 +120,6 @@ void draw_thor_screen(void)
 
        bmp_display((unsigned long)prog_base, x, y);
 
-       lcd_printf("%s (%s)\n", U_BOOT_VERSION, U_BOOT_DATE);
-
-       lcd_printf("\nConnection established\n");
-
-       char *pit_compatible = getenv("dfu_alt_pit_compatible");
-       if (pit_compatible) {
-               lcd_printf("Platform compatible with PIT Version: %s\n",
-                          pit_compatible);
-       };
 }
 
 void draw_thor_progress(unsigned long long int total_file_size,