plugins: Fix the builds for targets lacking HAVE_BACKLIGHT
Change-Id: Ifdb1501834b7ea63ca6f731bbd6414305d7e0001
This commit is contained in:
parent
5dbb757670
commit
a3398a2143
7 changed files with 40 additions and 10 deletions
|
@ -1105,8 +1105,10 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
rb->lcd_set_foreground(LCD_WHITE);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* Turn off backlight timeout */
|
||||
backlight_ignore_timeout();
|
||||
#endif
|
||||
|
||||
rb->srand( *rb->current_tick );
|
||||
|
||||
|
@ -1118,8 +1120,10 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
configfile_save(CFG_FILE, config, 1, 0);
|
||||
|
||||
rb->lcd_setfont(FONT_UI);
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* Turn on backlight timeout (revert to settings) */
|
||||
backlight_use_settings();
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -303,8 +303,10 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
{
|
||||
(void)parameter;
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* Turn off backlight timeout */
|
||||
backlight_ignore_timeout();
|
||||
#endif
|
||||
|
||||
rb->show_logo();
|
||||
|
||||
|
@ -312,8 +314,10 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
if(!rb->action_userabort(3*HZ))
|
||||
roll_credits();
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* Turn on backlight timeout (revert to settings) */
|
||||
backlight_use_settings();
|
||||
#endif
|
||||
|
||||
return PLUGIN_OK;
|
||||
}
|
||||
|
|
|
@ -1532,7 +1532,9 @@ static void fft_cleanup(void)
|
|||
#ifndef HAVE_LCD_COLOR
|
||||
grey_release();
|
||||
#endif
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
backlight_use_settings();
|
||||
#endif
|
||||
|
||||
/* save settings if changed */
|
||||
if (rb->memcmp(&fft, &fft_disk, sizeof(fft)))
|
||||
|
@ -1583,7 +1585,9 @@ static bool fft_setup(void)
|
|||
mylcd_clear_display();
|
||||
myosd_lcd_update();
|
||||
#endif
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
backlight_ignore_timeout();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->trigger_cpu_boost();
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include "plugin.h"
|
||||
#include "helper.h"
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* Force the backlight on */
|
||||
void backlight_force_on(void)
|
||||
{
|
||||
|
@ -51,6 +52,7 @@ void backlight_use_settings(void)
|
|||
backlight_timeout_plugged);
|
||||
#endif /* CONFIG_CHARGING */
|
||||
}
|
||||
#endif /* HAVE_BACKLIGHT */
|
||||
|
||||
#ifdef HAVE_SW_POWEROFF
|
||||
static bool original_sw_poweroff_state = true;
|
||||
|
|
|
@ -579,6 +579,7 @@ RB_WRAP(mixer_frequency)
|
|||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* DEVICE LIGHTING CONTROL */
|
||||
RB_WRAP(backlight_onoff)
|
||||
{
|
||||
|
@ -599,11 +600,6 @@ SIMPLE_VOID_WRAPPER(remote_backlight_force_on);
|
|||
SIMPLE_VOID_WRAPPER(remote_backlight_use_settings);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
SIMPLE_VOID_WRAPPER(buttonlight_force_on);
|
||||
SIMPLE_VOID_WRAPPER(buttonlight_use_settings);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
RB_WRAP(backlight_brightness_set)
|
||||
{
|
||||
|
@ -618,6 +614,12 @@ RB_WRAP(backlight_brightness_set)
|
|||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif /* HAVE_BACKLIGHT */
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
SIMPLE_VOID_WRAPPER(buttonlight_force_on);
|
||||
SIMPLE_VOID_WRAPPER(buttonlight_use_settings);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
RB_WRAP(buttonlight_brightness_set)
|
||||
|
@ -954,6 +956,7 @@ static const luaL_Reg rocklib[] =
|
|||
RB_FUNC(pcm),
|
||||
RB_FUNC(mixer_frequency),
|
||||
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* DEVICE LIGHTING CONTROL */
|
||||
RB_FUNC(backlight_onoff),
|
||||
|
||||
|
@ -966,15 +969,16 @@ static const luaL_Reg rocklib[] =
|
|||
RB_FUNC(remote_backlight_use_settings),
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
RB_FUNC(backlight_brightness_set),
|
||||
#endif
|
||||
#endif /* HAVE_BACKLIGHT */
|
||||
|
||||
#ifdef HAVE_BUTTON_LIGHT
|
||||
RB_FUNC(buttonlight_force_on),
|
||||
RB_FUNC(buttonlight_use_settings),
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
||||
RB_FUNC(backlight_brightness_set),
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
|
||||
RB_FUNC(buttonlight_brightness_set),
|
||||
#endif
|
||||
|
|
|
@ -2971,8 +2971,10 @@ static void cleanup(void)
|
|||
rb->cpu_boost(false);
|
||||
#endif
|
||||
end_pf_thread();
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
/* Turn on backlight timeout (revert to settings) */
|
||||
backlight_use_settings();
|
||||
#endif
|
||||
|
||||
#ifdef USEGSLIB
|
||||
grey_release();
|
||||
|
@ -3508,7 +3510,9 @@ static int pictureflow_main(void)
|
|||
draw_splashscreen(pf_idx.buf, pf_idx.buf_sz);
|
||||
if(pf_cfg.backlight_mode == 0) {
|
||||
/* Turn off backlight timeout */
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
backlight_ignore_timeout();
|
||||
#endif
|
||||
}
|
||||
|
||||
init_scroll_lines();
|
||||
|
|
|
@ -569,10 +569,12 @@ static enum plugin_status main_menu(void)
|
|||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
rb->remote_backlight_on();
|
||||
#endif
|
||||
rb->backlight_on();
|
||||
#endif
|
||||
break;
|
||||
case 1:
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
|
@ -583,10 +585,12 @@ static enum plugin_status main_menu(void)
|
|||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
rb->remote_backlight_on();
|
||||
#endif
|
||||
rb->backlight_on();
|
||||
#endif
|
||||
break;
|
||||
case 2: /* export to textfile */
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
|
@ -596,10 +600,12 @@ static enum plugin_status main_menu(void)
|
|||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
rb->remote_backlight_on();
|
||||
#endif
|
||||
rb->backlight_on();
|
||||
#endif
|
||||
break;
|
||||
case 3: /* import from textfile */
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
|
@ -609,10 +615,12 @@ static enum plugin_status main_menu(void)
|
|||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
rb->cpu_boost(false);
|
||||
#endif
|
||||
#ifdef HAVE_BACKLIGHT
|
||||
#ifdef HAVE_REMOTE_LCD
|
||||
rb->remote_backlight_on();
|
||||
#endif
|
||||
rb->backlight_on();
|
||||
#endif
|
||||
break;
|
||||
case 4:
|
||||
if (!start_shuffled_play())
|
||||
|
|
Loading…
Reference in a new issue