power manager

ugfx_release_2.6
root 2014-07-06 21:14:24 +03:00
parent 76625b646b
commit b2a8500231
1 changed files with 9 additions and 4 deletions

View File

@ -177,8 +177,13 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
if (g->g.Powermode == (powermode_t)g->p.ptr)
return;
switch((powermode_t)g->p.ptr) {
case powerOff: case powerOn: case powerSleep: case powerDeepSleep:
//board_power(g, (powermode_t)g->p.ptr);
case powerOff:
case powerSleep:
case powerDeepSleep:
write_index(g, PCF8812_SET_FUNC | PCF8812_PD);
break;
case powerOn:
write_index(g, PCF8812_SET_FUNC);
break;
default:
return;
@ -218,13 +223,13 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
case GDISP_CONTROL_BACKLIGHT:
if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100;
//board_backlight(g, (unsigned)g->p.ptr);
set_backlight(g, (unsigned)g->p.ptr);
g->g.Backlight = (unsigned)g->p.ptr;
return;
case GDISP_CONTROL_CONTRAST:
if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100;
//board_contrast(g, (unsigned)g->p.ptr);
// ToDo
g->g.Contrast = (unsigned)g->p.ptr;
return;
}