A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

plugins HAVE_BACKLIGHT helper remove ifdefs in favor of dummy functions lessen the ifdef hell

Change-Id: I52f830284e4599f3fc3a75c27dda27058b8de1a3

+140 -178
+1 -4
apps/plugins/2048.c
··· 148 148 /* prepares for exit */ 149 149 static void cleanup(void) 150 150 { 151 - #ifdef HAVE_BACKLIGHT 152 151 backlight_use_settings(); 153 - #endif 154 152 } 155 153 156 154 /* returns 2 or 4 */ ··· 700 698 max_numeral_width = rb->font_get_width(rb->font_get(WHAT_FONT), '0'); 701 699 #endif 702 700 703 - #ifdef HAVE_BACKLIGHT 704 701 backlight_ignore_timeout(); 705 - #endif 702 + 706 703 draw(); 707 704 } 708 705
+4 -4
apps/plugins/brickmania.c
··· 2533 2533 #if LCD_DEPTH > 1 2534 2534 rb->lcd_set_backdrop(NULL); 2535 2535 #endif 2536 - #ifdef HAVE_BACKLIGHT 2536 + 2537 2537 /* Turn off backlight timeout */ 2538 2538 backlight_ignore_timeout(); 2539 - #endif 2539 + 2540 2540 /* now go ahead and have fun! */ 2541 2541 rb->srand( *rb->current_tick ); 2542 2542 brickmania_loadgame(); ··· 2565 2565 configfile_save(CONFIG_FILE_NAME,config,1,0); 2566 2566 /* Restore user's original backlight setting */ 2567 2567 rb->lcd_setfont(FONT_UI); 2568 - #ifdef HAVE_BACKLIGHT 2568 + 2569 2569 /* Turn on backlight timeout (revert to settings) */ 2570 2570 backlight_use_settings(); 2571 - #endif 2571 + 2572 2572 return PLUGIN_OK; 2573 2573 }
+4 -4
apps/plugins/chopper.c
··· 1083 1083 rb->lcd_set_foreground(LCD_WHITE); 1084 1084 #endif 1085 1085 1086 - #ifdef HAVE_BACKLIGHT 1086 + 1087 1087 /* Turn off backlight timeout */ 1088 1088 backlight_ignore_timeout(); 1089 - #endif 1089 + 1090 1090 1091 1091 rb->srand( *rb->current_tick ); 1092 1092 ··· 1098 1098 configfile_save(CFG_FILE, config, 1, 0); 1099 1099 1100 1100 rb->lcd_setfont(FONT_UI); 1101 - #ifdef HAVE_BACKLIGHT 1101 + 1102 1102 /* Turn on backlight timeout (revert to settings) */ 1103 1103 backlight_use_settings(); 1104 - #endif 1104 + 1105 1105 1106 1106 return ret; 1107 1107 }
+4 -4
apps/plugins/credits.c
··· 303 303 { 304 304 (void)parameter; 305 305 306 - #ifdef HAVE_BACKLIGHT 306 + 307 307 /* Turn off backlight timeout */ 308 308 backlight_ignore_timeout(); 309 - #endif 309 + 310 310 311 311 #if LCD_DEPTH>=16 312 312 rb->lcd_set_foreground (LCD_WHITE); ··· 318 318 if(!rb->action_userabort(3*HZ)) 319 319 roll_credits(); 320 320 321 - #ifdef HAVE_BACKLIGHT 321 + 322 322 /* Turn on backlight timeout (revert to settings) */ 323 323 backlight_use_settings(); 324 - #endif 324 + 325 325 326 326 return PLUGIN_OK; 327 327 }
+4 -8
apps/plugins/demystify.c
··· 262 262 263 263 static void cleanup(void) 264 264 { 265 - #ifdef HAVE_BACKLIGHT 265 + 266 266 backlight_use_settings(); 267 - #ifdef HAVE_REMOTE_LCD 268 267 remote_backlight_use_settings(); 269 - #endif 270 - #endif 268 + 271 269 } 272 270 273 271 #ifdef HAVE_LCD_COLOR ··· 438 436 #if LCD_DEPTH > 1 439 437 rb->lcd_set_backdrop(NULL); 440 438 #endif 441 - #ifdef HAVE_BACKLIGHT 439 + 442 440 backlight_ignore_timeout(); 443 - #ifdef HAVE_REMOTE_LCD 444 441 remote_backlight_ignore_timeout(); 445 - #endif 446 - #endif 442 + 447 443 ret = plugin_main(); 448 444 449 445 return ret;
+4 -4
apps/plugins/doom/rockdoom.c
··· 722 722 systemvol= rb->global_settings->volume-rb->global_settings->volume%mod; 723 723 general_translucency = default_translucency; // phares 724 724 725 - #ifdef HAVE_BACKLIGHT 725 + 726 726 backlight_ignore_timeout(); 727 - #endif 727 + 728 728 #ifdef RB_PROFILE 729 729 rb->profile_thread(); 730 730 #endif ··· 738 738 #ifdef RB_PROFILE 739 739 rb->profstop(); 740 740 #endif 741 - #ifdef HAVE_BACKLIGHT 741 + 742 742 backlight_use_settings(); 743 - #endif 743 + 744 744 M_SaveDefaults (); 745 745 746 746 I_Quit(); // Make SURE everything was closed out right
+2 -4
apps/plugins/fft/fft.c
··· 1184 1184 #ifndef HAVE_LCD_COLOR 1185 1185 grey_release(); 1186 1186 #endif 1187 - #ifdef HAVE_BACKLIGHT 1187 + 1188 1188 backlight_use_settings(); 1189 - #endif 1190 1189 1191 1190 /* save settings if changed */ 1192 1191 if (rb->memcmp(&fft, &fft_disk, sizeof(fft))) ··· 1237 1236 mylcd_clear_display(); 1238 1237 myosd_lcd_update(); 1239 1238 #endif 1240 - #ifdef HAVE_BACKLIGHT 1239 + 1241 1240 backlight_ignore_timeout(); 1242 - #endif 1243 1241 1244 1242 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 1245 1243 rb->trigger_cpu_boost();
+2 -4
apps/plugins/fire.c
··· 279 279 #ifndef HAVE_LCD_COLOR 280 280 grey_release(); 281 281 #endif 282 - #ifdef HAVE_BACKLIGHT 282 + 283 283 /* Turn on backlight timeout (revert to settings) */ 284 284 backlight_use_settings(); 285 - #endif 286 285 } 287 286 288 287 ··· 371 370 #if LCD_DEPTH > 1 372 371 rb->lcd_set_backdrop(NULL); 373 372 #endif 374 - #ifdef HAVE_BACKLIGHT 373 + 375 374 /* Turn off backlight timeout */ 376 375 backlight_ignore_timeout(); 377 - #endif 378 376 379 377 #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 380 378 rb->lcd_set_mode(LCD_MODE_PAL256);
+4 -4
apps/plugins/fireworks.c
··· 358 358 359 359 /* set everything up.. no BL timeout, no backdrop, 360 360 white-text-on-black-background. */ 361 - #ifdef HAVE_BACKLIGHT 361 + 362 362 backlight_ignore_timeout(); 363 - #endif 363 + 364 364 #if LCD_DEPTH > 1 365 365 rb->lcd_set_backdrop(NULL); 366 366 rb->lcd_set_background(LCD_BLACK); ··· 524 524 break; 525 525 } 526 526 } 527 - #ifdef HAVE_BACKLIGHT 527 + 528 528 /* Turn on backlight timeout (revert to settings) */ 529 529 backlight_use_settings(); 530 - #endif 530 + 531 531 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 532 532 rb->cpu_boost(false); 533 533 #endif
-4
apps/plugins/imageviewer/imageviewer.c
··· 1064 1064 ARRAYLEN(config), IMGVIEW_SETTINGS_MINVERSION); 1065 1065 rb->memcpy(&old_settings, &settings, sizeof (settings)); 1066 1066 1067 - #ifdef HAVE_BACKLIGHT 1068 1067 /* Turn off backlight timeout */ 1069 1068 backlight_ignore_timeout(); 1070 - #endif 1071 1069 1072 1070 #if LCD_DEPTH > 1 1073 1071 rb->lcd_set_backdrop(NULL); ··· 1094 1092 rb->storage_spindown(rb->global_settings->disk_spindown); 1095 1093 #endif 1096 1094 1097 - #ifdef HAVE_BACKLIGHT 1098 1095 /* Turn on backlight timeout (revert to settings) */ 1099 1096 backlight_use_settings(); 1100 - #endif 1101 1097 1102 1098 #ifdef USEGSLIB 1103 1099 grey_release(); /* deinitialize */
+5 -10
apps/plugins/lamp.c
··· 103 103 int current_brightness = MAX_BRIGHTNESS_SETTING; 104 104 backlight_brightness_set(MAX_BRIGHTNESS_SETTING); 105 105 #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ 106 - #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 106 + 107 107 buttonlight_brightness_set(MAX_BRIGHTNESS_SETTING); 108 - #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */ 109 108 110 109 #ifdef HAVE_LCD_INVERT 111 110 #ifdef HAVE_NEGATIVE_LCD ··· 116 115 #endif /* HAVE_LCD_INVERT */ 117 116 118 117 backlight_force_on(); 119 - #ifdef HAVE_BUTTON_LIGHT 120 118 buttonlight_force_on(); 121 - #endif /* HAVE_BUTTON_LIGHT */ 119 + 122 120 123 121 rb->lcd_clear_display(); 124 122 rb->lcd_update(); ··· 207 205 208 206 /* restore */ 209 207 backlight_use_settings(); 210 - #ifdef HAVE_BUTTON_LIGHT 208 + 211 209 buttonlight_use_settings(); 212 - #endif /* HAVE_BUTTON_LIGHT */ 213 210 214 211 #ifdef HAVE_LCD_INVERT 215 212 rb->lcd_set_invert_display(rb->global_settings->invert); 216 213 #endif /* HAVE_LCD_INVERT */ 217 214 218 - #ifdef HAVE_BACKLIGHT_BRIGHTNESS 215 + 219 216 backlight_brightness_use_setting(); 220 - #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ 221 - #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 217 + 222 218 buttonlight_brightness_use_setting(); 223 - #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */ 224 219 225 220 #if LCD_DEPTH > 1 226 221 rb->lcd_set_background(bg_color);
+42 -6
apps/plugins/lib/helper.c
··· 58 58 backlight_timeout_plugged); 59 59 #endif /* CONFIG_CHARGING */ 60 60 } 61 - #endif /* HAVE_BACKLIGHT */ 61 + #else /* HAVE_BACKLIGHT */ 62 + /* DUMMY FUNCTIONS */ 63 + void backlight_force_on(void){} 64 + void backlight_ignore_timeout(void){} 65 + void backlight_use_settings(void){} 66 + #endif /* !HAVE_BACKLIGHT */ 62 67 63 68 #ifdef HAVE_SW_POWEROFF 64 69 static bool original_sw_poweroff_state = true; ··· 73 78 { 74 79 rb->button_set_sw_poweroff_state(original_sw_poweroff_state); 75 80 } 76 - #endif 81 + #else /* HAVE_SW_POWEROFF */ 82 + /* DUMMY FUNCTIONS */ 83 + void sw_poweroff_disable(void){} 84 + void sw_poweroff_restore(void){} 85 + #endif /* !HAVE_SW_POWEROFF */ 77 86 78 87 #ifdef HAVE_REMOTE_LCD 79 88 /* Force the backlight on */ ··· 106 115 remote_backlight_timeout_plugged); 107 116 #endif /* CONFIG_CHARGING */ 108 117 } 109 - #endif /* HAVE_REMOTE_LCD */ 118 + #else /* HAVE_REMOTE_LCD */ 119 + /* DUMMY FUNCTIONS */ 120 + void remote_backlight_force_on(void){} 121 + void remote_backlight_ignore_timeout(void){} 122 + void remote_backlight_use_settings(void){} 123 + #endif /* !HAVE_REMOTE_LCD */ 110 124 111 125 #ifdef HAVE_BUTTON_LIGHT 112 126 /* Force the buttonlight on */ ··· 133 147 { 134 148 rb->buttonlight_set_timeout(rb->global_settings->buttonlight_timeout); 135 149 } 136 - #endif /* HAVE_BUTTON_LIGHT */ 150 + #else /* HAVE_BUTTON_LIGHT */ 151 + /* DUMMY FUNCTIONS */ 152 + void buttonlight_force_on(void){} 153 + void buttonlight_force_off(void){} 154 + void buttonlight_ignore_timeout(void){} 155 + void buttonlight_use_settings(void){} 156 + #endif /* !HAVE_BUTTON_LIGHT */ 137 157 138 158 #ifdef HAVE_BACKLIGHT_BRIGHTNESS 139 159 void backlight_brightness_set(int brightness) ··· 145 165 { 146 166 rb->backlight_set_brightness(rb->global_settings->brightness); 147 167 } 148 - #endif /* HAVE_BACKLIGHT_BRIGHTNESS */ 168 + #else /* HAVE_BACKLIGHT_BRIGHTNESS */ 169 + /* DUMMY FUNCTIONS */ 170 + void backlight_brightness_set(int brightness) 171 + { 172 + (void)brightness; 173 + } 174 + void backlight_brightness_use_setting(void){} 175 + 176 + #endif /* !HAVE_BACKLIGHT_BRIGHTNESS */ 149 177 150 178 #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 151 179 void buttonlight_brightness_set(int brightness) ··· 157 185 { 158 186 rb->buttonlight_set_brightness(rb->global_settings->buttonlight_brightness); 159 187 } 160 - #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */ 188 + #else /* HAVE_BUTTONLIGHT_BRIGHTNESS */ 189 + /* DUMMY FUNCTIONS */ 190 + void buttonlight_brightness_set(int brightness) 191 + { 192 + (void)brightness; 193 + } 194 + 195 + void buttonlight_brightness_use_setting(void){} 196 + #endif /* !HAVE_BUTTONLIGHT_BRIGHTNESS */
-10
apps/plugins/lib/helper.h
··· 32 32 void backlight_ignore_timeout(void); 33 33 void backlight_use_settings(void); 34 34 35 - #ifdef HAVE_SW_POWEROFF 36 35 /** 37 36 * Disable and restore software poweroff (i.e. holding PLAY on iPods). 38 37 * Only call _restore() if _disable() was called earlier! 39 38 */ 40 39 void sw_poweroff_disable(void); 41 40 void sw_poweroff_restore(void); 42 - #endif 43 41 44 - #ifdef HAVE_REMOTE_LCD 45 42 void remote_backlight_force_on(void); 46 43 void remote_backlight_ignore_timeout(void); 47 44 void remote_backlight_use_settings(void); 48 - #endif 49 45 50 - #ifdef HAVE_BUTTON_LIGHT 51 46 void buttonlight_force_on(void); 52 47 void buttonlight_force_off(void); 53 48 void buttonlight_ignore_timeout(void); 54 49 void buttonlight_use_settings(void); 55 - #endif 56 50 57 51 /** 58 52 * Backlight brightness adjustment settings 59 53 */ 60 - #ifdef HAVE_BACKLIGHT_BRIGHTNESS 61 54 void backlight_brightness_set(int brightness); 62 55 void backlight_brightness_use_setting(void); 63 - #endif 64 56 65 - #ifdef HAVE_BUTTONLIGHT_BRIGHTNESS 66 57 void buttonlight_brightness_set(int brightness); 67 58 void buttonlight_brightness_use_setting(void); 68 - #endif /* HAVE_BUTTONLIGHT_BRIGHTNESS */ 69 59 70 60 #endif /* _LIB_HELPER_H_ */
+1 -4
apps/plugins/maze.c
··· 498 498 struct maze maze; 499 499 (void)parameter; 500 500 501 - #ifdef HAVE_BACKLIGHT 502 501 /* Turn off backlight timeout */ 503 502 backlight_ignore_timeout(); 504 - #endif 505 503 506 504 /* Seed the RNG */ 507 505 rb->srand(*rb->current_tick); ··· 591 589 #endif 592 590 } 593 591 /* Turn on backlight timeout (revert to settings) */ 594 - #ifdef HAVE_BACKLIGHT 595 592 backlight_use_settings(); 596 - #endif 593 + 597 594 return ((quit == 1) ? PLUGIN_OK : PLUGIN_USB_CONNECTED); 598 595 }
+1 -4
apps/plugins/mazezam.c
··· 256 256 ******************************************************************************/ 257 257 static void restore_lcd_settings(void) { 258 258 /* Turn on backlight timeout (revert to settings) */ 259 - #ifdef HAVE_BACKLIGHT 260 259 backlight_use_settings(); 261 - #endif 262 260 263 261 /* Restore the old settings */ 264 262 #if LCD_DEPTH > 1 ··· 272 270 * Adjust the LCD settings to suit MazezaM levels 273 271 ******************************************************************************/ 274 272 static void plugin_lcd_settings(void) { 275 - #ifdef HAVE_BACKLIGHT 276 273 /* Turn off backlight timeout */ 277 274 backlight_ignore_timeout(); 278 - #endif 275 + 279 276 /* Set the new settings */ 280 277 #ifdef HAVE_LCD_COLOR 281 278 rb->lcd_set_background(MAZEZAM_BG_COLOR);
+1 -4
apps/plugins/mpegplayer/mpegplayer.c
··· 1215 1215 static void osdbacklight_hw_on_video_mode(bool video_on) 1216 1216 { 1217 1217 if (video_on) { 1218 - #ifdef HAVE_BACKLIGHT 1219 1218 /* Turn off backlight timeout */ 1220 1219 backlight_ignore_timeout(); 1221 - #endif 1220 + 1222 1221 #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 1223 1222 rb->remove_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook); 1224 1223 #endif ··· 1226 1225 #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 1227 1226 rb->add_event(LCD_EVENT_ACTIVATION, osd_lcd_enable_hook); 1228 1227 #endif 1229 - #ifdef HAVE_BACKLIGHT 1230 1228 /* Revert to user's backlight settings */ 1231 1229 backlight_use_settings(); 1232 - #endif 1233 1230 } 1234 1231 } 1235 1232
+2 -4
apps/plugins/oscilloscope.c
··· 1939 1939 rb->lcd_set_foreground(LCD_DEFAULT_FG); 1940 1940 rb->lcd_set_background(LCD_DEFAULT_BG); 1941 1941 #endif 1942 - #ifdef HAVE_BACKLIGHT 1942 + 1943 1943 /* Turn on backlight timeout (revert to settings) */ 1944 1944 backlight_use_settings(); 1945 - #endif 1946 1945 1947 1946 /* save settings if changed */ 1948 1947 if (rb->memcmp(&osc, &osc_disk, sizeof(osc))) ··· 1975 1974 mixer_sampr = rb->mixer_get_frequency(); 1976 1975 #endif 1977 1976 1978 - #ifdef HAVE_BACKLIGHT 1979 1977 /* Turn off backlight timeout */ 1980 1978 backlight_ignore_timeout(); 1981 - #endif 1979 + 1982 1980 graphmode_setup(); 1983 1981 } 1984 1982
+2 -2
apps/plugins/pacbox/pacbox.c
··· 809 809 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 810 810 rb->cpu_boost(false); 811 811 #endif 812 - #ifdef HAVE_BACKLIGHT 812 + 813 813 backlight_use_settings(); 814 - #endif 814 + 815 815 return PLUGIN_OK; 816 816 }
+1 -2
apps/plugins/pictureflow/pictureflow.c
··· 3493 3493 rb->cpu_boost(false); 3494 3494 #endif 3495 3495 end_pf_thread(); 3496 - #ifdef HAVE_BACKLIGHT 3496 + 3497 3497 /* Turn on backlight timeout (revert to settings) */ 3498 3498 backlight_use_settings(); 3499 - #endif 3500 3499 3501 3500 #ifdef USEGSLIB 3502 3501 grey_release();
+4 -4
apps/plugins/plasma.c
··· 140 140 #ifndef HAVE_LCD_COLOR 141 141 grey_release(); 142 142 #endif 143 - #ifdef HAVE_BACKLIGHT 143 + 144 144 /* Turn on backlight timeout (revert to settings) */ 145 145 backlight_use_settings(); 146 - #endif 146 + 147 147 #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 148 148 rb->lcd_set_mode(LCD_MODE_RGB565); 149 149 #endif ··· 321 321 #if LCD_DEPTH > 1 322 322 rb->lcd_set_backdrop(NULL); 323 323 #endif 324 - #ifdef HAVE_BACKLIGHT 324 + 325 325 /* Turn off backlight timeout */ 326 326 backlight_ignore_timeout(); 327 - #endif 327 + 328 328 #if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) 329 329 rb->lcd_set_mode(LCD_MODE_PAL256); 330 330 #endif
+3 -4
apps/plugins/pong.c
··· 750 750 this to avoid the compiler warning about it */ 751 751 (void)parameter; 752 752 753 - #ifdef HAVE_BACKLIGHT 754 753 /* Turn off backlight timeout */ 755 754 backlight_ignore_timeout(); 756 - #endif 755 + 757 756 /* Clear screen */ 758 757 rb->lcd_clear_display(); 759 758 ··· 792 791 rb->lcd_clear_display(); 793 792 } 794 793 } 795 - #ifdef HAVE_BACKLIGHT 794 + 796 795 /* Turn on backlight timeout (revert to settings) */ 797 796 backlight_use_settings(); 798 - #endif 797 + 799 798 return (game == 0) ? PLUGIN_OK : PLUGIN_USB_CONNECTED; 800 799 }
-4
apps/plugins/puzzles/rockbox.c
··· 3390 3390 3391 3391 static void exit_handler(void) 3392 3392 { 3393 - #ifdef HAVE_SW_POWEROFF 3394 3393 sw_poweroff_restore(); 3395 - #endif 3396 3394 3397 3395 unload_fonts(); 3398 3396 shutdown_tlsf(); ··· 3652 3650 { 3653 3651 rb_atexit(exit_handler); 3654 3652 3655 - #ifdef HAVE_SW_POWEROFF 3656 3653 sw_poweroff_disable(); 3657 - #endif 3658 3654 3659 3655 init_default_settings(); 3660 3656 init_fonttab();
+6 -12
apps/plugins/resistor.c
··· 574 574 575 575 static void led_resistance_calc(void) 576 576 { 577 - #ifdef HAVE_BACKLIGHT 578 577 backlight_ignore_timeout(); 579 - #endif 578 + 580 579 int voltage_menu_selection, button_press, j, k, l, foreward_current = 0; 581 580 int fwd_current_selection = 0; 582 581 bool quit = false; ··· 769 768 default: 770 769 quit = true; 771 770 772 - #ifdef HAVE_BACKLIGHT 773 771 backlight_use_settings(); 774 - #endif 772 + 775 773 break; 776 774 } 777 775 } ··· 784 782 785 783 static void resistance_to_color(void) 786 784 { 787 - #ifdef HAVE_BACKLIGHT 788 785 backlight_ignore_timeout(); 789 - #endif 786 + 790 787 int menu_selection; 791 788 int menu_selection_tol; 792 789 int button_press; ··· 910 907 break; 911 908 default: 912 909 quit = true; 913 - #ifdef HAVE_BACKLIGHT 910 + 914 911 backlight_use_settings(); 915 - #endif 912 + 916 913 break; 917 914 } 918 915 } ··· 924 921 925 922 static void color_to_resistance(void) 926 923 { 927 - #ifdef HAVE_BACKLIGHT 928 924 backlight_ignore_timeout(); 929 - #endif 925 + 930 926 bool quit = false; 931 927 int button_input = 0; 932 928 ··· 995 991 case PLA_SELECT: 996 992 default: 997 993 quit = true; 998 - #ifdef HAVE_BACKLIGHT 999 994 backlight_use_settings(); 1000 - #endif 1001 995 break; 1002 996 } 1003 997 }
+3 -8
apps/plugins/rockblox.c
··· 1498 1498 #ifdef HAS_BUTTON_HOLD 1499 1499 if (rb->button_hold ()) { 1500 1500 /* Turn on backlight timeout (revert to settings) */ 1501 - #ifdef HAVE_BACKLIGHT 1502 1501 backlight_use_settings(); 1503 - #endif 1504 1502 rb->splash(0, "Paused"); 1505 1503 while (rb->button_hold ()) 1506 1504 rb->sleep(HZ/10); 1507 - #ifdef HAVE_BACKLIGHT 1508 1505 /* Turn off backlight timeout */ 1509 1506 backlight_ignore_timeout(); 1510 - #endif 1507 + 1511 1508 /* get rid of the splash text */ 1512 1509 rb->lcd_bitmap (rockblox_background, 0, 0, LCD_WIDTH, LCD_HEIGHT); 1513 1510 show_details (); ··· 1677 1674 1678 1675 rb->lcd_setfont (FONT_SYSFIXED); 1679 1676 1680 - #ifdef HAVE_BACKLIGHT 1681 1677 /* Turn off backlight timeout */ 1682 1678 backlight_ignore_timeout(); 1683 - #endif 1679 + 1684 1680 load_game(); 1685 1681 resume_file = resume; 1686 1682 ··· 1728 1724 1729 1725 /* Save user's HighScore */ 1730 1726 highscore_save(SCORE_FILE, highscores, NUM_SCORES); 1731 - #ifdef HAVE_BACKLIGNT 1727 + 1732 1728 backlight_use_settings(); 1733 - #endif 1734 1729 1735 1730 return PLUGIN_OK; 1736 1731 }
+2 -4
apps/plugins/rockboy/menu.c
··· 83 83 rb->lcd_set_mode(LCD_MODE_RGB565); 84 84 #endif 85 85 86 - #ifdef HAVE_BACKLIGHT 87 86 backlight_use_settings(); 88 - #endif 87 + 89 88 /* Clean out the button Queue */ 90 89 while (rb->button_get(false) != BUTTON_NONE) 91 90 rb->yield(); ··· 139 138 rb->lcd_set_mode(LCD_MODE_PAL256); 140 139 #endif 141 140 142 - #ifdef HAVE_BACKLIGHT 143 141 /* ignore backlight time out */ 144 142 backlight_ignore_timeout(); 145 - #endif 143 + 146 144 return ret; 147 145 } 148 146
+1 -4
apps/plugins/rockboy/rockboy.c
··· 602 602 rb->lcd_set_mode(LCD_MODE_PAL256); 603 603 #endif 604 604 605 - #ifdef HAVE_BACKLIGHT 606 605 /* ignore backlight time out */ 607 606 backlight_ignore_timeout(); 608 - #endif 607 + 609 608 gnuboy_main(parameter); 610 609 611 610 #ifdef HAVE_WHEEL_POSITION ··· 616 615 rb->lcd_set_mode(LCD_MODE_RGB565); 617 616 #endif 618 617 619 - #ifdef HAVE_BACKLIGHT 620 618 backlight_use_settings(); 621 - #endif 622 619 623 620 if(!rb->audio_status()) 624 621 rockboy_pcm_close();
+2 -4
apps/plugins/rocklife.c
··· 474 474 char *ptemp; 475 475 (void)(parameter); 476 476 477 - #ifdef HAVE_BACKLIGHT 478 477 backlight_ignore_timeout(); 479 - #endif 478 + 480 479 #if LCD_DEPTH > 1 481 480 rb->lcd_set_backdrop(NULL); 482 481 #ifdef HAVE_LCD_COLOR ··· 580 579 rb->yield(); 581 580 } 582 581 583 - #ifdef HAVE_BACKLIGHT 584 582 backlight_use_settings(); 585 - #endif 583 + 586 584 return usb? PLUGIN_USB_CONNECTED: PLUGIN_OK; 587 585 }
+3 -4
apps/plugins/sdl/main.c
··· 64 64 if(audiobuf) 65 65 memset(audiobuf, 0, 4); /* clear */ 66 66 67 - #ifdef HAVE_BACKLIGHT 68 67 backlight_use_settings(); 69 - #endif 68 + 70 69 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 71 70 rb->cpu_boost(false); 72 71 #endif ··· 219 218 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 220 219 rb->cpu_boost(true); 221 220 #endif 222 - #ifdef HAVE_BACKLIGHT 221 + 223 222 backlight_ignore_timeout(); 224 - #endif 223 + 225 224 /* set the real exit handler */ 226 225 #undef rb_atexit 227 226 rb_atexit(cleanup);
+3 -4
apps/plugins/spacerocks.c
··· 2128 2128 #endif 2129 2129 /* universal font */ 2130 2130 rb->lcd_setfont(FONT_SYSFIXED); 2131 - #ifdef HAVE_BACKLIGHT 2131 + 2132 2132 /* Turn off backlight timeout */ 2133 2133 backlight_ignore_timeout(); 2134 - #endif 2134 + 2135 2135 highscore_load(SCORE_FILE, highscores, NUM_SCORES); 2136 2136 rb->srand(*rb->current_tick); 2137 2137 ··· 2143 2143 2144 2144 rb->lcd_setfont(FONT_UI); 2145 2145 highscore_save(SCORE_FILE, highscores, NUM_SCORES); 2146 - #ifdef HAVE_BACKLIGHT 2146 + 2147 2147 /* Turn on backlight timeout (revert to settings) */ 2148 2148 backlight_use_settings(); 2149 - #endif 2150 2149 2151 2150 return ret; 2152 2151 }
+3 -4
apps/plugins/speedread.c
··· 141 141 { 142 142 if(custom_font != FONT_UI) 143 143 rb->font_unload(custom_font); 144 - #ifdef HAVE_BACKLIGHT 144 + 145 145 backlight_use_settings(); 146 - #endif 146 + 147 147 } 148 148 149 149 /* returns height of drawn area */ ··· 302 302 303 303 static void init_drawing(void) 304 304 { 305 - #ifdef HAVE_BACKLIGHT 306 305 backlight_ignore_timeout(); 307 - #endif 306 + 308 307 atexit(cleanup); 309 308 310 309 rb->lcd_set_background(OUTSIDE_COLOR);
+4 -4
apps/plugins/starfield.c
··· 324 324 int ret; 325 325 326 326 (void)parameter; 327 - #ifdef HAVE_BACKLIGHT 327 + 328 328 /* Turn off backlight timeout */ 329 329 backlight_ignore_timeout(); 330 - #endif 330 + 331 331 ret = plugin_main(); 332 - #ifdef HAVE_BACKLIGHT 332 + 333 333 /* Turn on backlight timeout (revert to settings) */ 334 334 backlight_use_settings(); 335 - #endif 335 + 336 336 return ret; 337 337 }
+2 -4
apps/plugins/test_disk.c
··· 467 467 468 468 rb->srand(*rb->current_tick); 469 469 470 - #ifdef HAVE_BACKLIGHT 471 470 /* Turn off backlight timeout */ 472 471 backlight_ignore_timeout(); 473 - #endif 472 + 474 473 475 474 while(!quit) 476 475 { ··· 489 488 } 490 489 491 490 /* Turn on backlight timeout (revert to settings) */ 492 - #ifdef HAVE_BACKLIGHT 493 491 backlight_use_settings(); 494 - #endif 492 + 495 493 rb->rmdir(testbasedir); 496 494 497 495 return PLUGIN_OK;
+4 -4
apps/plugins/test_fps.c
··· 401 401 #if (CONFIG_PLATFORM & PLATFORM_NATIVE) 402 402 cpu_freq = *rb->cpu_frequency; /* remember CPU frequency */ 403 403 #endif 404 - #ifdef HAVE_BACKLIGHT 404 + 405 405 backlight_ignore_timeout(); 406 - #endif 406 + 407 407 time_main_update(); 408 408 rb->sleep(HZ); 409 409 #if defined(HAVE_LCD_COLOR) && (MEMORYSIZE > 2) ··· 424 424 (cpu_freq + 500000) / 1000000); 425 425 log_text(str); 426 426 #endif 427 - #ifdef HAVE_BACKLIGHT 427 + 428 428 backlight_use_settings(); 429 - #endif 429 + 430 430 /* wait until user closes plugin */ 431 431 plugin_quit(); 432 432
+4 -4
apps/plugins/test_gfx.c
··· 495 495 rb->lcd_set_backdrop(NULL); 496 496 rb->lcd_clear_display(); 497 497 #endif 498 - #ifdef HAVE_BACKLIGHT 498 + 499 499 backlight_ignore_timeout(); 500 - #endif 500 + 501 501 rb->splashf(0, "LCD driver performance test, please wait %d sec", 502 502 7*4*DURATION/HZ); 503 503 init_rand_table(); ··· 522 522 (cpu_freq + 500000) / 1000000); 523 523 #endif 524 524 rb->close(log_fd); 525 - #ifdef HAVE_BACKLIGHT 525 + 526 526 backlight_use_settings(); 527 - #endif 527 + 528 528 #ifdef TEST_GREYLIB 529 529 grey_release(); 530 530 #endif
+4 -4
apps/plugins/test_grey.c
··· 123 123 } 124 124 for (i = 0; i <= STEPS; i++) 125 125 input_levels[i] = lcd_levels[i] = (255 * i + (STEPS/2)) / STEPS; 126 - #ifdef HAVE_BACKLIGHT 126 + 127 127 backlight_ignore_timeout(); 128 - #endif 128 + 129 129 grey_set_background(0); /* set background to black */ 130 130 grey_clear_display(); 131 131 grey_show(true); ··· 221 221 } 222 222 223 223 grey_release(); 224 - #ifdef HAVE_BACKLIGHT 224 + 225 225 backlight_use_settings(); 226 - #endif 226 + 227 227 return PLUGIN_OK; 228 228 }
+3 -4
apps/plugins/wormlet.c
··· 2428 2428 2429 2429 rb->lcd_clear_display(); 2430 2430 2431 - #ifdef HAVE_BACKLIGHT 2432 2431 /* Turn off backlight timeout */ 2433 2432 backlight_ignore_timeout(); 2434 - #endif 2433 + 2435 2434 /* start the game */ 2436 2435 while (game_result == 1) 2437 2436 game_result = run(); ··· 2439 2438 switch (game_result) 2440 2439 { 2441 2440 case 2: 2442 - #ifdef HAVE_BACKLIGHT 2441 + 2443 2442 /* Turn on backlight timeout (revert to settings) */ 2444 2443 backlight_use_settings(); 2445 - #endif 2444 + 2446 2445 return false; 2447 2446 break; 2448 2447 }
+3 -4
apps/plugins/xobox.c
··· 1297 1297 rb->lcd_set_backdrop(NULL); 1298 1298 #endif 1299 1299 1300 - #ifdef HAVE_BACKLIGHT 1301 1300 /* Turn off backlight timeout */ 1302 1301 backlight_ignore_timeout(); 1303 - #endif 1302 + 1304 1303 highscore_load(SCORE_FILE, highscores, NUM_SCORES); 1305 1304 1306 1305 if (!load_game()) { ··· 1310 1309 randomize (); 1311 1310 ret = xobox_loop (); 1312 1311 1313 - #ifdef HAVE_BACKLIGHT 1312 + 1314 1313 /* Turn on backlight timeout (revert to settings) */ 1315 1314 backlight_use_settings(); 1316 - #endif 1315 + 1317 1316 rb->lcd_setfont (FONT_UI); 1318 1317 1319 1318 highscore_save(SCORE_FILE, highscores, NUM_SCORES);
+2 -4
apps/plugins/xworld/sys.c
··· 122 122 #ifdef HAVE_ADJUSTABLE_CPU_FREQ 123 123 rb->cpu_boost(false); 124 124 #endif 125 - #ifdef HAVE_BACKLIGHT 125 + 126 126 backlight_use_settings(); 127 - #endif 128 127 } 129 128 130 129 static bool sys_do_help(void) ··· 428 427 void sys_init(struct System* sys, const char* title) 429 428 { 430 429 (void) title; 431 - #ifdef HAVE_BACKLIGHT 430 + 432 431 backlight_ignore_timeout(); 433 - #endif 434 432 rb_atexit(exit_handler); 435 433 save_sys = sys; 436 434 rb->memset(&sys->input, 0, sizeof(sys->input));