summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-24 18:14:32 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-24 18:17:19 -0400
commita3398a21435045fb6af1af14cc5638fd0cb52119 (patch)
tree701d1f73cc89742ea4ae21d11a60f2f029284099
parent5dbb7576700fad81d6ab722b96620fdbbf462be4 (diff)
downloadrockbox-a3398a21435045fb6af1af14cc5638fd0cb52119.tar.gz
rockbox-a3398a21435045fb6af1af14cc5638fd0cb52119.zip
plugins: Fix the builds for targets lacking HAVE_BACKLIGHT
Change-Id: Ifdb1501834b7ea63ca6f731bbd6414305d7e0001
-rw-r--r--apps/plugins/chopper.c4
-rw-r--r--apps/plugins/credits.c6
-rw-r--r--apps/plugins/fft/fft.c4
-rw-r--r--apps/plugins/lib/helper.c2
-rw-r--r--apps/plugins/lua/rocklib.c22
-rw-r--r--apps/plugins/pictureflow/pictureflow.c4
-rw-r--r--apps/plugins/random_folder_advance_config.c8
7 files changed, 40 insertions, 10 deletions
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index f42801f10f..37fed5dd01 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -1105,8 +1105,10 @@ enum plugin_status plugin_start(const void* parameter)
1105 rb->lcd_set_foreground(LCD_WHITE); 1105 rb->lcd_set_foreground(LCD_WHITE);
1106#endif 1106#endif
1107 1107
1108#ifdef HAVE_BACKLIGHT
1108 /* Turn off backlight timeout */ 1109 /* Turn off backlight timeout */
1109 backlight_ignore_timeout(); 1110 backlight_ignore_timeout();
1111#endif
1110 1112
1111 rb->srand( *rb->current_tick ); 1113 rb->srand( *rb->current_tick );
1112 1114
@@ -1118,8 +1120,10 @@ enum plugin_status plugin_start(const void* parameter)
1118 configfile_save(CFG_FILE, config, 1, 0); 1120 configfile_save(CFG_FILE, config, 1, 0);
1119 1121
1120 rb->lcd_setfont(FONT_UI); 1122 rb->lcd_setfont(FONT_UI);
1123#ifdef HAVE_BACKLIGHT
1121 /* Turn on backlight timeout (revert to settings) */ 1124 /* Turn on backlight timeout (revert to settings) */
1122 backlight_use_settings(); 1125 backlight_use_settings();
1126#endif
1123 1127
1124 return ret; 1128 return ret;
1125} 1129}
diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c
index 593b54277e..3374a33415 100644
--- a/apps/plugins/credits.c
+++ b/apps/plugins/credits.c
@@ -303,17 +303,21 @@ enum plugin_status plugin_start(const void* parameter)
303{ 303{
304 (void)parameter; 304 (void)parameter;
305 305
306#ifdef HAVE_BACKLIGHT
306 /* Turn off backlight timeout */ 307 /* Turn off backlight timeout */
307 backlight_ignore_timeout(); 308 backlight_ignore_timeout();
309#endif
308 310
309 rb->show_logo(); 311 rb->show_logo();
310 312
311 /* Show the logo for about 3 secs allowing the user to stop */ 313 /* Show the logo for about 3 secs allowing the user to stop */
312 if(!rb->action_userabort(3*HZ)) 314 if(!rb->action_userabort(3*HZ))
313 roll_credits(); 315 roll_credits();
314 316
317#ifdef HAVE_BACKLIGHT
315 /* Turn on backlight timeout (revert to settings) */ 318 /* Turn on backlight timeout (revert to settings) */
316 backlight_use_settings(); 319 backlight_use_settings();
320#endif
317 321
318 return PLUGIN_OK; 322 return PLUGIN_OK;
319} 323}
diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c
index 1349b07012..9edb02a15e 100644
--- a/apps/plugins/fft/fft.c
+++ b/apps/plugins/fft/fft.c
@@ -1532,7 +1532,9 @@ static void fft_cleanup(void)
1532#ifndef HAVE_LCD_COLOR 1532#ifndef HAVE_LCD_COLOR
1533 grey_release(); 1533 grey_release();
1534#endif 1534#endif
1535#ifdef HAVE_BACKLIGHT
1535 backlight_use_settings(); 1536 backlight_use_settings();
1537#endif
1536 1538
1537 /* save settings if changed */ 1539 /* save settings if changed */
1538 if (rb->memcmp(&fft, &fft_disk, sizeof(fft))) 1540 if (rb->memcmp(&fft, &fft_disk, sizeof(fft)))
@@ -1583,7 +1585,9 @@ static bool fft_setup(void)
1583 mylcd_clear_display(); 1585 mylcd_clear_display();
1584 myosd_lcd_update(); 1586 myosd_lcd_update();
1585#endif 1587#endif
1588#ifdef HAVE_BACKLIGHT
1586 backlight_ignore_timeout(); 1589 backlight_ignore_timeout();
1590#endif
1587 1591
1588#ifdef HAVE_ADJUSTABLE_CPU_FREQ 1592#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1589 rb->trigger_cpu_boost(); 1593 rb->trigger_cpu_boost();
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c
index 6eb3498791..f36c01b23e 100644
--- a/apps/plugins/lib/helper.c
+++ b/apps/plugins/lib/helper.c
@@ -22,6 +22,7 @@
22#include "plugin.h" 22#include "plugin.h"
23#include "helper.h" 23#include "helper.h"
24 24
25#ifdef HAVE_BACKLIGHT
25/* Force the backlight on */ 26/* Force the backlight on */
26void backlight_force_on(void) 27void backlight_force_on(void)
27{ 28{
@@ -51,6 +52,7 @@ void backlight_use_settings(void)
51 backlight_timeout_plugged); 52 backlight_timeout_plugged);
52#endif /* CONFIG_CHARGING */ 53#endif /* CONFIG_CHARGING */
53} 54}
55#endif /* HAVE_BACKLIGHT */
54 56
55#ifdef HAVE_SW_POWEROFF 57#ifdef HAVE_SW_POWEROFF
56static bool original_sw_poweroff_state = true; 58static bool original_sw_poweroff_state = true;
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index e6eb543eda..8eab08f987 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -579,6 +579,7 @@ RB_WRAP(mixer_frequency)
579 return 1; 579 return 1;
580} 580}
581 581
582#ifdef HAVE_BACKLIGHT
582/* DEVICE LIGHTING CONTROL */ 583/* DEVICE LIGHTING CONTROL */
583RB_WRAP(backlight_onoff) 584RB_WRAP(backlight_onoff)
584{ 585{
@@ -599,11 +600,6 @@ SIMPLE_VOID_WRAPPER(remote_backlight_force_on);
599SIMPLE_VOID_WRAPPER(remote_backlight_use_settings); 600SIMPLE_VOID_WRAPPER(remote_backlight_use_settings);
600#endif 601#endif
601 602
602#ifdef HAVE_BUTTON_LIGHT
603SIMPLE_VOID_WRAPPER(buttonlight_force_on);
604SIMPLE_VOID_WRAPPER(buttonlight_use_settings);
605#endif
606
607#ifdef HAVE_BACKLIGHT_BRIGHTNESS 603#ifdef HAVE_BACKLIGHT_BRIGHTNESS
608RB_WRAP(backlight_brightness_set) 604RB_WRAP(backlight_brightness_set)
609{ 605{
@@ -618,6 +614,12 @@ RB_WRAP(backlight_brightness_set)
618 return 0; 614 return 0;
619} 615}
620#endif 616#endif
617#endif /* HAVE_BACKLIGHT */
618
619#ifdef HAVE_BUTTON_LIGHT
620SIMPLE_VOID_WRAPPER(buttonlight_force_on);
621SIMPLE_VOID_WRAPPER(buttonlight_use_settings);
622#endif
621 623
622#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 624#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
623RB_WRAP(buttonlight_brightness_set) 625RB_WRAP(buttonlight_brightness_set)
@@ -954,6 +956,7 @@ static const luaL_Reg rocklib[] =
954 RB_FUNC(pcm), 956 RB_FUNC(pcm),
955 RB_FUNC(mixer_frequency), 957 RB_FUNC(mixer_frequency),
956 958
959#ifdef HAVE_BACKLIGHT
957 /* DEVICE LIGHTING CONTROL */ 960 /* DEVICE LIGHTING CONTROL */
958 RB_FUNC(backlight_onoff), 961 RB_FUNC(backlight_onoff),
959 962
@@ -966,15 +969,16 @@ static const luaL_Reg rocklib[] =
966 RB_FUNC(remote_backlight_use_settings), 969 RB_FUNC(remote_backlight_use_settings),
967#endif 970#endif
968 971
972#ifdef HAVE_BACKLIGHT_BRIGHTNESS
973 RB_FUNC(backlight_brightness_set),
974#endif
975#endif /* HAVE_BACKLIGHT */
976
969#ifdef HAVE_BUTTON_LIGHT 977#ifdef HAVE_BUTTON_LIGHT
970 RB_FUNC(buttonlight_force_on), 978 RB_FUNC(buttonlight_force_on),
971 RB_FUNC(buttonlight_use_settings), 979 RB_FUNC(buttonlight_use_settings),
972#endif 980#endif
973 981
974#ifdef HAVE_BACKLIGHT_BRIGHTNESS
975 RB_FUNC(backlight_brightness_set),
976#endif
977
978#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 982#ifdef HAVE_BUTTONLIGHT_BRIGHTNESS
979 RB_FUNC(buttonlight_brightness_set), 983 RB_FUNC(buttonlight_brightness_set),
980#endif 984#endif
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index a32298f861..ba3ae3018f 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -2971,8 +2971,10 @@ static void cleanup(void)
2971 rb->cpu_boost(false); 2971 rb->cpu_boost(false);
2972#endif 2972#endif
2973 end_pf_thread(); 2973 end_pf_thread();
2974#ifdef HAVE_BACKLIGHT
2974 /* Turn on backlight timeout (revert to settings) */ 2975 /* Turn on backlight timeout (revert to settings) */
2975 backlight_use_settings(); 2976 backlight_use_settings();
2977#endif
2976 2978
2977#ifdef USEGSLIB 2979#ifdef USEGSLIB
2978 grey_release(); 2980 grey_release();
@@ -3508,7 +3510,9 @@ static int pictureflow_main(void)
3508 draw_splashscreen(pf_idx.buf, pf_idx.buf_sz); 3510 draw_splashscreen(pf_idx.buf, pf_idx.buf_sz);
3509 if(pf_cfg.backlight_mode == 0) { 3511 if(pf_cfg.backlight_mode == 0) {
3510 /* Turn off backlight timeout */ 3512 /* Turn off backlight timeout */
3513#ifdef HAVE_BACKLIGHT
3511 backlight_ignore_timeout(); 3514 backlight_ignore_timeout();
3515#endif
3512 } 3516 }
3513 3517
3514 init_scroll_lines(); 3518 init_scroll_lines();
diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c
index 68440e4602..c9dce0223b 100644
--- a/apps/plugins/random_folder_advance_config.c
+++ b/apps/plugins/random_folder_advance_config.c
@@ -569,10 +569,12 @@ static enum plugin_status main_menu(void)
569#ifdef HAVE_ADJUSTABLE_CPU_FREQ 569#ifdef HAVE_ADJUSTABLE_CPU_FREQ
570 rb->cpu_boost(false); 570 rb->cpu_boost(false);
571#endif 571#endif
572#ifdef HAVE_BACKLIGHT
572#ifdef HAVE_REMOTE_LCD 573#ifdef HAVE_REMOTE_LCD
573 rb->remote_backlight_on(); 574 rb->remote_backlight_on();
574#endif 575#endif
575 rb->backlight_on(); 576 rb->backlight_on();
577#endif
576 break; 578 break;
577 case 1: 579 case 1:
578#ifdef HAVE_ADJUSTABLE_CPU_FREQ 580#ifdef HAVE_ADJUSTABLE_CPU_FREQ
@@ -583,10 +585,12 @@ static enum plugin_status main_menu(void)
583#ifdef HAVE_ADJUSTABLE_CPU_FREQ 585#ifdef HAVE_ADJUSTABLE_CPU_FREQ
584 rb->cpu_boost(false); 586 rb->cpu_boost(false);
585#endif 587#endif
588#ifdef HAVE_BACKLIGHT
586#ifdef HAVE_REMOTE_LCD 589#ifdef HAVE_REMOTE_LCD
587 rb->remote_backlight_on(); 590 rb->remote_backlight_on();
588#endif 591#endif
589 rb->backlight_on(); 592 rb->backlight_on();
593#endif
590 break; 594 break;
591 case 2: /* export to textfile */ 595 case 2: /* export to textfile */
592#ifdef HAVE_ADJUSTABLE_CPU_FREQ 596#ifdef HAVE_ADJUSTABLE_CPU_FREQ
@@ -596,10 +600,12 @@ static enum plugin_status main_menu(void)
596#ifdef HAVE_ADJUSTABLE_CPU_FREQ 600#ifdef HAVE_ADJUSTABLE_CPU_FREQ
597 rb->cpu_boost(false); 601 rb->cpu_boost(false);
598#endif 602#endif
603#ifdef HAVE_BACKLIGHT
599#ifdef HAVE_REMOTE_LCD 604#ifdef HAVE_REMOTE_LCD
600 rb->remote_backlight_on(); 605 rb->remote_backlight_on();
601#endif 606#endif
602 rb->backlight_on(); 607 rb->backlight_on();
608#endif
603 break; 609 break;
604 case 3: /* import from textfile */ 610 case 3: /* import from textfile */
605#ifdef HAVE_ADJUSTABLE_CPU_FREQ 611#ifdef HAVE_ADJUSTABLE_CPU_FREQ
@@ -609,10 +615,12 @@ static enum plugin_status main_menu(void)
609#ifdef HAVE_ADJUSTABLE_CPU_FREQ 615#ifdef HAVE_ADJUSTABLE_CPU_FREQ
610 rb->cpu_boost(false); 616 rb->cpu_boost(false);
611#endif 617#endif
618#ifdef HAVE_BACKLIGHT
612#ifdef HAVE_REMOTE_LCD 619#ifdef HAVE_REMOTE_LCD
613 rb->remote_backlight_on(); 620 rb->remote_backlight_on();
614#endif 621#endif
615 rb->backlight_on(); 622 rb->backlight_on();
623#endif
616 break; 624 break;
617 case 4: 625 case 4:
618 if (!start_shuffled_play()) 626 if (!start_shuffled_play())