1
0

Add custom backlight feature

This commit is contained in:
Kai Ryu 2013-11-21 12:33:03 +09:00
parent 90e0dfe75f
commit 8451031e0a

View File

@ -33,6 +33,16 @@ void backlight_init(void)
void backlight_increase(void)
{
#ifdef BACKLIGHT_CUSTOM
if (backlight_config.enable) {
if (backlight_config.level < BACKLIGHT_LEVELS) {
backlight_config.level++;
eeconfig_write_backlight(backlight_config.raw);
}
dprintf("backlight custom increase: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
}
#else
if(backlight_config.level < BACKLIGHT_LEVELS)
{
backlight_config.level++;
@ -41,10 +51,22 @@ void backlight_increase(void)
}
dprintf("backlight increase: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
#endif
}
void backlight_decrease(void)
{
#ifdef BACKLIGHT_CUSTOM
if (backlight_config.enable) {
if(backlight_config.level > 1)
{
backlight_config.level--;
eeconfig_write_backlight(backlight_config.raw);
}
dprintf("backlight custom decrease: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
}
#else
if(backlight_config.level > 0)
{
backlight_config.level--;
@ -53,6 +75,7 @@ void backlight_decrease(void)
}
dprintf("backlight decrease: %u\n", backlight_config.level);
backlight_set(backlight_config.level);
#endif
}
void backlight_toggle(void)