From 843546c75fdff809e482253854ae200fdc9c5f59 Mon Sep 17 00:00:00 2001 From: Przemyslaw Marczak Date: Wed, 2 Apr 2014 16:13:59 +0200 Subject: [PATCH] lib: tizen: thor screen update 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 Changes for v2015.04-rc1: - Replace to Changes for v2015.10-rc5 - correct usage of removed typedef 'bmp_image_t' Signed-off-by: Przemyslaw Marczak --- drivers/usb/gadget/f_thor.c | 2 ++ include/libtizen.h | 2 +- lib/tizen/tizen.c | 52 +++++++++++++++++++++++++++++++-------------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c index 7cad0d1..32fe030 100644 --- a/drivers/usb/gadget/f_thor.c +++ b/drivers/usb/gadget/f_thor.c @@ -707,6 +707,7 @@ int thor_init(void) #ifdef CONFIG_TIZEN #ifdef CONFIG_LCD /* TODO : Need to enable LCD*/ draw_thor_init_screen(); + draw_thor_screen(); #endif #endif /* Wait for a device enumeration and configuration settings */ @@ -726,6 +727,7 @@ int thor_init(void) #ifdef CONFIG_TIZEN #ifdef CONFIG_LCD /* TODO : Need to enable LCD*/ draw_thor_screen(); + draw_thor_connected(); #endif #endif thor_set_dma(thor_rx_data_buf, strlen("THOR")); diff --git a/include/libtizen.h b/include/libtizen.h index 62a2958..2ba32b0 100644 --- a/include/libtizen.h +++ b/include/libtizen.h @@ -14,8 +14,8 @@ #ifdef CONFIG_LCD 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); #endif diff --git a/lib/tizen/tizen.c b/lib/tizen/tizen.c index 14cad82..680cd5d 100644 --- a/lib/tizen/tizen.c +++ b/lib/tizen/tizen.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include @@ -62,11 +61,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 +87,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,21 +119,12 @@ 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, unsigned long long int downloaded_file_size) { - static bmp_image_t *progress_bar = NULL; + static struct bmp_image *progress_bar = NULL; static int last_percent; void *bar_bitmap; @@ -140,7 +160,7 @@ void draw_thor_progress(unsigned long long int total_file_size, NULL, &bar_bitmap); if (!progress_bar) - progress_bar = (bmp_image_t *)prog_middle; + progress_bar = (struct bmp_image *)prog_middle; /* set bar position */ x = 40 + LOGO_X_OFS; -- 2.7.4