summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c11
-rw-r--r--apps/settings.h12
-rw-r--r--apps/settings_menu.c19
3 files changed, 39 insertions, 3 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 8dcad6bae4..d2b220f893 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -647,6 +647,14 @@ static const struct bit_entry hd_bits[] =
647 {8|SIGNED, S_O(rec_agc_maxgain_line), 96, "agc maximum line gain", NULL}, 647 {8|SIGNED, S_O(rec_agc_maxgain_line), 96, "agc maximum line gain", NULL},
648 {3, S_O(rec_agc_cliptime), 1, "agc cliptime", "0.2s,0.4s,0.6s,0.8,1s"}, 648 {3, S_O(rec_agc_cliptime), 1, "agc cliptime", "0.2s,0.4s,0.6s,0.8,1s"},
649#endif 649#endif
650
651#ifdef HAVE_REMOTE_LCD
652#ifdef HAS_REMOTE_BUTTON_HOLD
653 {2, S_O(remote_backlight_on_button_hold), 0, "remote backlight on button hold",
654 "normal,off,on" },
655#endif
656#endif
657
650 /* If values are just added to the end, no need to bump the version. */ 658 /* If values are just added to the end, no need to bump the version. */
651 /* new stuff to be added at the end */ 659 /* new stuff to be added at the end */
652 660
@@ -1108,7 +1116,10 @@ void settings_apply(void)
1108#ifdef CONFIG_CHARGING 1116#ifdef CONFIG_CHARGING
1109 remote_backlight_set_timeout_plugged(global_settings.remote_backlight_timeout_plugged); 1117 remote_backlight_set_timeout_plugged(global_settings.remote_backlight_timeout_plugged);
1110#endif 1118#endif
1119#ifdef HAS_REMOTE_BUTTON_HOLD
1120 remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold);
1111#endif 1121#endif
1122#endif /* HAVE_REMOTE_LCD */
1112#ifdef CONFIG_BACKLIGHT 1123#ifdef CONFIG_BACKLIGHT
1113 backlight_set_timeout(global_settings.backlight_timeout); 1124 backlight_set_timeout(global_settings.backlight_timeout);
1114#ifdef CONFIG_CHARGING 1125#ifdef CONFIG_CHARGING
diff --git a/apps/settings.h b/apps/settings.h
index b66e96b765..561dc59375 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -354,11 +354,15 @@ struct user_settings
354 then according to timeout_values[] */ 354 then according to timeout_values[] */
355 int remote_backlight_timeout_plugged; 355 int remote_backlight_timeout_plugged;
356 bool remote_caption_backlight; /* turn on backlight at end and start of track */ 356 bool remote_caption_backlight; /* turn on backlight at end and start of track */
357#ifdef HAS_REMOTE_BUTTON_HOLD
358 int remote_backlight_on_button_hold; /* what to do with remote backlight when hold
359 switch is on */
360#endif
357#ifdef HAVE_REMOTE_LCD_TICKING 361#ifdef HAVE_REMOTE_LCD_TICKING
358 bool remote_reduce_ticking; /* 0=normal operation, 362 bool remote_reduce_ticking; /* 0=normal operation,
359 1=EMI reduce on with cost more CPU. */ 363 1=EMI reduce on with cost more CPU. */
360#endif 364#endif
361#endif 365#endif /* HAVE_REMOTE_LCD */
362 366
363 bool next_folder; /* move to next folder */ 367 bool next_folder; /* move to next folder */
364 bool runtimedb; /* runtime database active? */ 368 bool runtimedb; /* runtime database active? */
@@ -446,10 +450,12 @@ struct user_settings
446 bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */ 450 bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */
447#endif 451#endif
448#ifdef HAS_BUTTON_HOLD 452#ifdef HAS_BUTTON_HOLD
449 int backlight_on_button_hold; 453 int backlight_on_button_hold; /* what to do with backlight when hold
454 switch is on */
450#endif 455#endif
451#ifdef HAVE_LCD_SLEEP 456#ifdef HAVE_LCD_SLEEP
452 int lcd_sleep_after_backlight_off; 457 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
458 has turned off */
453#endif 459#endif
454#endif /* CONFIG_BACKLIGHT */ 460#endif /* CONFIG_BACKLIGHT */
455 461
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 5f84dc1d34..ab19c820be 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -315,6 +315,22 @@ static bool remote_caption_backlight(void)
315 return set_bool((char *)str(LANG_CAPTION_BACKLIGHT), 315 return set_bool((char *)str(LANG_CAPTION_BACKLIGHT),
316 &global_settings.remote_caption_backlight); 316 &global_settings.remote_caption_backlight);
317} 317}
318
319#ifdef HAS_REMOTE_BUTTON_HOLD
320static bool remote_backlight_on_button_hold(void)
321{
322 static const struct opt_items names[3] = {
323 { STR(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL) },
324 { STR(LANG_OFF) },
325 { STR(LANG_ON) },
326 };
327 return set_option(str(LANG_BACKLIGHT_ON_BUTTON_HOLD),
328 &global_settings.remote_backlight_on_button_hold,
329 INT, names, 3,
330 remote_backlight_set_on_button_hold);
331}
332#endif /* HAS_BUTTON_HOLD */
333
318#endif /* HAVE_REMOTE_LCD */ 334#endif /* HAVE_REMOTE_LCD */
319 335
320#ifdef HAVE_LCD_CONTRAST 336#ifdef HAVE_LCD_CONTRAST
@@ -1887,6 +1903,9 @@ static bool lcd_remote_settings_menu(void)
1887 { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), 1903 { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING),
1888 remote_backlight_timer_plugged }, 1904 remote_backlight_timer_plugged },
1889#endif 1905#endif
1906#ifdef HAS_REMOTE_BUTTON_HOLD
1907 { ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD), remote_backlight_on_button_hold },
1908#endif
1890 { ID2P(LANG_CAPTION_BACKLIGHT), remote_caption_backlight }, 1909 { ID2P(LANG_CAPTION_BACKLIGHT), remote_caption_backlight },
1891 { ID2P(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), set_remote_bl_filter_first_keypress }, 1910 { ID2P(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), set_remote_bl_filter_first_keypress },
1892 { ID2P(LANG_CONTRAST), remote_contrast }, 1911 { ID2P(LANG_CONTRAST), remote_contrast },