summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Leonhardt <sebastian.leonhardt@web.de>2019-06-25 22:32:39 +0200
committerSebastian Leonhardt <sebastian.leonhardt@web.de>2019-06-27 14:19:05 +0200
commit3e504c3dcd16ec93fb70b10c4f5a361633d7a77b (patch)
treeb39a57140b94fa8954c1dcdf8f7a564ffe01ecad
parent7b118eccac021934f7731396767dd0b50320acc6 (diff)
downloadrockbox-3e504c3dcd16ec93fb70b10c4f5a361633d7a77b.tar.gz
rockbox-3e504c3dcd16ec93fb70b10c4f5a361633d7a77b.zip
Fix reversal of "always/never" in "LCD setting > Sleep (After Backlight Off)"
The bug was introduced in a06d9c8. The patch also fixes some (more or less) related obsolete comments. Change-Id: I5e491d64574c37cdbc46b146d7cfc555d86b9a11
-rw-r--r--apps/settings.h12
-rw-r--r--firmware/backlight.c13
2 files changed, 14 insertions, 11 deletions
diff --git a/apps/settings.h b/apps/settings.h
index ee67a1734f..fc82c8bf45 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -668,9 +668,8 @@ struct user_settings
668#endif 668#endif
669 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */ 669 unsigned char kbd_file[MAX_FILENAME+1]; /* last keyboard */
670#endif /* HAVE_LCD_BITMAP */ 670#endif /* HAVE_LCD_BITMAP */
671 int backlight_timeout; /* backlight off timeout: 0-18 0=never, 671 int backlight_timeout; /* backlight off timeout: -1=never,
672 1=always, 672 0=always, or time in seconds */
673 then according to timeout_values[] */
674 bool caption_backlight; /* turn on backlight at end and start of track */ 673 bool caption_backlight; /* turn on backlight at end and start of track */
675 bool bl_filter_first_keypress; /* filter first keypress when dark? */ 674 bool bl_filter_first_keypress; /* filter first keypress when dark? */
676#if CONFIG_CHARGING 675#if CONFIG_CHARGING
@@ -689,7 +688,8 @@ struct user_settings
689#endif 688#endif
690#ifdef HAVE_LCD_SLEEP_SETTING 689#ifdef HAVE_LCD_SLEEP_SETTING
691 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight 690 int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight
692 has turned off */ 691 has turned off: -1=never, 0=always,
692 or time in seconds */
693#endif 693#endif
694#endif /* HAVE_BACKLIGHT */ 694#endif /* HAVE_BACKLIGHT */
695 695
@@ -707,8 +707,8 @@ struct user_settings
707#ifdef HAVE_REMOTE_LCD 707#ifdef HAVE_REMOTE_LCD
708 /* remote lcd */ 708 /* remote lcd */
709 int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */ 709 int remote_contrast; /* lcd contrast: 0-63 0=low 63=high */
710 int remote_backlight_timeout; /* backlight off timeout: 0-18 0=never, 710 int remote_backlight_timeout; /* backlight off timeout: -1=never,
711 1=always, then according to timeout_values[] */ 711 0=always, or time in seconds */
712 int remote_backlight_timeout_plugged; 712 int remote_backlight_timeout_plugged;
713 int remote_scroll_speed; /* long texts scrolling speed: 1-30 */ 713 int remote_scroll_speed; /* long texts scrolling speed: 1-30 */
714 int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */ 714 int remote_scroll_delay; /* delay (in 1/10s) before starting scroll */
diff --git a/firmware/backlight.c b/firmware/backlight.c
index caff55ce5e..e8a71af12c 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -209,15 +209,18 @@ static void backlight_lcd_sleep_countdown(bool start)
209 } 209 }
210 210
211 /* Start LCD sleep countdown */ 211 /* Start LCD sleep countdown */
212 if (lcd_sleep_timeout < 0) 212 if (lcd_sleep_timeout <= 0)
213 { 213 {
214 lcd_sleep_timer = 0; /* Setting == Always */ 214 lcd_sleep_timer = 0;
215 /* Ensure lcd_sleep() is called from backlight_thread() */ 215 if (lcd_sleep_timeout == 0) /* Setting == Always */
216 {
217 /* Ensure lcd_sleep() is called from backlight_thread() */
216#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM) 218#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_PWM)
217 queue_post(&backlight_queue, LCD_SLEEP, 0); 219 queue_post(&backlight_queue, LCD_SLEEP, 0);
218#else 220#else
219 lcd_sleep(); 221 lcd_sleep();
220#endif 222#endif
223 }
221 } 224 }
222 else 225 else
223 { 226 {