fixed high temperature warning defect
authorPark Yong Chul <yc1216.park@samsung.com>
Tue, 8 Jan 2013 08:05:40 +0000 (17:05 +0900)
committerPark Yong Chul <yc1216.park@samsung.com>
Tue, 8 Jan 2013 08:05:40 +0000 (17:05 +0900)
Change-Id: I30c8570f08f830ff3cfc45e069b87fd6404c11a5
Signed-off-by: Park Yong Chul <yc1216.park@samsung.com>
include/chg_fb.h
include/chg_png.h
packaging/charging-animation.spec
src/chg_drmd.c
src/chg_fb.c
src/chg_main.c
src/chg_png.c

index b72514b..8ff59d0 100755 (executable)
@@ -44,6 +44,6 @@ extern void fb_draw_img_normal_charging(FbInfo *fbi);
 extern void fb_draw_img_full_charging(FbInfo *fbi);
 extern void fb_draw_img_batt_err_plug(FbInfo *fbi);
 extern void fb_draw_img_batt_err_temp(FbInfo *fbi);
-
+extern void fb_draw_img_batt_err_charging(FbInfo *fbi);
 
 #endif /* __CHG_FB_H__ */
index 9eb3b1f..7c90b26 100755 (executable)
@@ -20,6 +20,10 @@ limitations under the License.
 
 #include "chg_fb.h"
 
+extern int png_img_width;
+extern int png_img_height;
+extern int png_img_width_batt_normal;
+extern int png_img_height_batt_normal;
 extern int read_png_file(char *file_name);
 extern void draw_png_img_xy(FbInfo *fbi, int x1, int y1);
 extern void release_png_res(void);
index eb7ce9e..09329be 100755 (executable)
@@ -1,7 +1,7 @@
 Name:       charging-animation
 Summary:    charging-animation
 ExclusiveArch:  %{arm}
-Version:    0.0.3
+Version:    0.0.4
 Release:    1
 Group:      misc
 License:    Flora Software License
index 7796059..ede8061 100755 (executable)
@@ -41,7 +41,11 @@ static int find_connector(st_drmdi *drmdi, int type)
        res_mode = drmdi->res_mode;
 
        for(i=0; i<res_mode->count_connectors; i++) {
-               connector =drmModeGetConnector(fd, res_mode->connectors[i]);
+               connector = drmModeGetConnector(fd, res_mode->connectors[i]);
+               if(connector == NULL) {
+                       LOGD("[find_connector] connector is NULL)\n");
+                       continue;
+               }
                if(connector->connector_type == type)
                        break;
 
@@ -170,7 +174,6 @@ static void free_drm_res(st_drmdi *drmdi)
 int drmd_open(st_drmdi *drmdi)
 {
        drm_magic_t magic;
-       drmVBlank vbl;
        void *ptr;
        int ret;
 
index 09bd34e..f5f706b 100755 (executable)
@@ -366,13 +366,68 @@ void fb_draw_img_batt_err_temp(FbInfo *fbi)
        sprintf(chg_img_filename, "%s%s.png",
                str_chg_img_dir, CHG_IMG_TEMP_ERROR);
 
+       /* clear screen based on normal_img & progress_img */
+       fb_fill_rect(fbi, s_normal_img_x, s_normal_img_y,\
+                       s_normal_img_x + png_img_width_batt_normal,\
+                       s_normal_img_y + png_img_height_batt_normal,\
+                       0x00000000);
+       fb_fill_rect(fbi, s_progress_img_x, s_progress_img_y,\
+                       s_progress_img_x + png_img_width,\
+                       s_progress_img_y + png_img_height, 0x00000000);
+
        if (read_png_file(chg_img_filename) < 0) {
                return;
        }
 
-       fb_clear_screen(fbi, 0x00000000);
        draw_png_img_xy(fbi, s_err_img_x, s_err_img_y);
        release_png_res();
 
 }
 
+/*-----------------------------------------------------------------------------
+  fb_draw_img_batt_err_charging()
+ ----------------------------------------------------------------------------*/
+void fb_draw_img_batt_err_charging(FbInfo *fbi)
+{
+       static int progress_cnt = 0;
+       static int batt_bar = 5;
+       char chg_img_filename[MAX_IMG_FILE_PATH];
+
+       batt_bar = batt_chg_level();
+
+       /* draw charging image based on batt_bar */
+       sprintf(chg_img_filename, "%s%s_%d.png",
+               str_chg_img_dir, CHG_IMG_NORMAL_PREFIX, batt_bar);
+
+       /* clear screen based on err_img */
+       fb_fill_rect(fbi, s_err_img_x, s_err_img_y,\
+                       s_err_img_x + png_img_width,\
+                       s_err_img_y + png_img_height, 0x00000000);
+
+       if (read_png_file(chg_img_filename) < 0) {
+               return;
+       }
+
+       draw_png_img_xy(fbi, s_normal_img_x, s_normal_img_y);
+       release_png_res();
+
+       png_img_width_batt_normal = png_img_width;
+       png_img_height_batt_normal = png_img_height;
+
+       /* draw charging image based on progress_cnt */
+       sprintf(chg_img_filename, "%s%s_%02d.png",
+               str_chg_img_dir, CHG_IMG_PROGRESS_PREFIX, progress_cnt + 1);
+
+       if (read_png_file(chg_img_filename) < 0) {
+               return;
+       }
+
+       draw_png_img_xy(fbi, s_progress_img_x, s_progress_img_y);
+       release_png_res();
+
+       progress_cnt++;
+       if (progress_cnt >= MAX_PROGRESS_CNT) {
+               progress_cnt = 0;
+       }
+
+}
index 36dd24e..4e96e2d 100755 (executable)
@@ -64,10 +64,10 @@ int event_monitor_process(void *arg)
        static int key_release_time = 0;
        char* key_dev_node;
 
-       LOGD("[main] event_monitor_process() started. %s\n", arg);
+       LOGD("[main] event_monitor_process() started. %s\n", (char *)arg);
 
        if ((fd = open(arg, O_RDWR)) < 0) {
-               LOGD("%s: open error, fd = %d\n", arg, fd);
+               LOGD("%s: open error, fd = %d\n", (char *)arg, fd);
                return -1;
        }
 
@@ -205,7 +205,7 @@ int charging_animation_process(void)
                        if (batt_err_temp_cnt % 2) {
                                fb_draw_img_batt_err_temp(&fbi);
                        } else {
-                               fb_draw_img_normal_charging(&fbi);
+                               fb_draw_img_batt_err_charging(&fbi);
                        }
                        batt_err_temp_cnt++;
                        break;
index 3a60f66..41403bf 100755 (executable)
@@ -21,6 +21,9 @@ limitations under the License.
 
 int png_img_width;
 int png_img_height;
+int png_img_width_batt_normal;
+int png_img_height_batt_normal;
+
 png_byte color_type;
 png_byte bit_depth;