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