#define CHG_ENV_BATT_STATUS "/sys/class/power_supply/battery/status"
static FbInfo fbi;
-static common_disp s_disp;
+static common_disp *s_disp;
static pthread_t keyevent_thread;
_DEBUG_EXCEPTION("read_degree failed, ret = [%d]", ret);
#endif
/* open display interface */
- if (fb_open(&fbi) < 0) {
- _DEBUG_EXCEPTION("fb_open failed");
+ s_disp = fb_open(&fbi);
+ if(!s_disp){
+ _DEBUG_EXCEPTION("fb_open failed!");
goto main_err_exit;
}
_DEBUG_LOG("charging-animation main function called.");
- chg_common_lcd_on(&s_disp);
+ chg_common_lcd_on(s_disp);
ret = pthread_create(&keyevent_thread, NULL, event_monitor_process, (void*)&event_cnt);
if (ret < 0) {
#ifndef __CHG_FB_H__
#define __CHG_FB_H__
+#include "rw-update_new_common_display.h"
+
typedef enum _CHG_SLEEP_TYPE {
CHG_SLEEP_TYPE_NORMAL,
CHG_SLEEP_TYPE_EFFECT,
int full_flag;
} FbInfo;
-extern int fb_open(FbInfo *fbi);
+extern common_disp* fb_open(FbInfo *fbi);
extern void fb_close(FbInfo *fbi);
extern int fb_display(FbInfo *fbi);
extern void fb_clear_screen(FbInfo *fbi, unsigned int color);
#ifdef CAIRO_LIB
#include "rw-update_new_cairo.h"
#endif
-#include "rw-update_new_common_display.h"
static common_disp s_disp;
/*-----------------------------------------------------------------------------
fb_open()
----------------------------------------------------------------------------*/
-int fb_open(FbInfo *fbi)
+common_disp* fb_open(FbInfo *fbi)
{
_FUNC_ENTER;
if (chg_common_display_init(&s_disp)) {
_DEBUG_EXCEPTION("chg_common_display_init fail!!");
_FUNC_EXIT;
- return -1;
+ return NULL;
}
fbi->buf[FRONT_BUFFER] = s_disp.buffer[FRONT_BUFFER];
fbi->sz = s_disp.buffer_size;
_FUNC_EXIT;
- return 0;
+ return &s_disp;
}
/*-----------------------------------------------------------------------------
/* SET DPMS ON */
_DEBUG_LOG("DPMS ON!\n");
tdm_output_set_dpms(st_disp->output, TDM_OUTPUT_DPMS_ON);
+ _DEBUG_LOG("mode:wh[%d %d] \n", st_disp->width, st_disp->height);
_FUNC_EXIT;
return;