diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/backlight.c | 18 | ||||
-rw-r--r-- | firmware/export/audio.h | 2 | ||||
-rw-r--r-- | firmware/export/backlight.h | 2 |
3 files changed, 8 insertions, 14 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 25c295197f..3acc89c27c 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -191,10 +191,6 @@ static int remote_backlight_on_button_hold = 0; | |||
191 | 191 | ||
192 | #ifdef HAVE_LCD_SLEEP | 192 | #ifdef HAVE_LCD_SLEEP |
193 | #ifdef HAVE_LCD_SLEEP_SETTING | 193 | #ifdef HAVE_LCD_SLEEP_SETTING |
194 | const signed char lcd_sleep_timeout_value[10] = | ||
195 | { | ||
196 | -1, 0, 5, 10, 15, 20, 30, 45, 60, 90 | ||
197 | }; | ||
198 | static int lcd_sleep_timeout = 10*HZ; | 194 | static int lcd_sleep_timeout = 10*HZ; |
199 | #else | 195 | #else |
200 | /* Target defines needed value */ | 196 | /* Target defines needed value */ |
@@ -885,23 +881,21 @@ void backlight_set_on_button_hold(int index) | |||
885 | #endif /* HAS_BUTTON_HOLD */ | 881 | #endif /* HAS_BUTTON_HOLD */ |
886 | 882 | ||
887 | #ifdef HAVE_LCD_SLEEP_SETTING | 883 | #ifdef HAVE_LCD_SLEEP_SETTING |
888 | void lcd_set_sleep_after_backlight_off(int index) | 884 | void lcd_set_sleep_after_backlight_off(int timeout_seconds) |
889 | { | 885 | { |
890 | if ((unsigned)index >= sizeof(lcd_sleep_timeout_value)) | 886 | lcd_sleep_timeout = HZ * timeout_seconds; |
891 | /* if given a weird value, use default */ | ||
892 | index = 3; | ||
893 | |||
894 | lcd_sleep_timeout = HZ * lcd_sleep_timeout_value[index]; | ||
895 | 887 | ||
896 | if (is_backlight_on(true)) | 888 | if (is_backlight_on(true)) |
897 | /* Timer will be set when bl turns off or bl set to on. */ | 889 | /* Timer will be set when bl turns off or bl set to on. */ |
898 | return; | 890 | return; |
899 | 891 | ||
900 | /* Backlight is Off */ | 892 | /* Backlight is Off */ |
901 | if (lcd_sleep_timeout < 0) | 893 | if (lcd_sleep_timeout < 0) |
894 | lcd_sleep_timer = 0; /* Never */ | ||
895 | else if (lcd_sleep_timeout == 0) | ||
902 | lcd_sleep_timer = 1; /* Always - sleep next tick */ | 896 | lcd_sleep_timer = 1; /* Always - sleep next tick */ |
903 | else | 897 | else |
904 | lcd_sleep_timer = lcd_sleep_timeout; /* Never, other */ | 898 | lcd_sleep_timer = lcd_sleep_timeout; /* other */ |
905 | } | 899 | } |
906 | #endif /* HAVE_LCD_SLEEP_SETTING */ | 900 | #endif /* HAVE_LCD_SLEEP_SETTING */ |
907 | 901 | ||
diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 5710f9f653..5ed9c706a4 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h | |||
@@ -69,7 +69,7 @@ struct mp3entry* audio_current_track(void); | |||
69 | struct mp3entry* audio_next_track(void); | 69 | struct mp3entry* audio_next_track(void); |
70 | bool audio_peek_track(struct mp3entry* id3, int offset); | 70 | bool audio_peek_track(struct mp3entry* id3, int offset); |
71 | #ifdef HAVE_DISK_STORAGE | 71 | #ifdef HAVE_DISK_STORAGE |
72 | void audio_set_buffer_margin(int setting); | 72 | void audio_set_buffer_margin(int seconds); |
73 | #endif | 73 | #endif |
74 | void audio_error_clear(void); | 74 | void audio_error_clear(void); |
75 | int audio_get_file_pos(void); | 75 | int audio_get_file_pos(void); |
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index 19e5f9b91b..a1c65a3b4e 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h | |||
@@ -57,7 +57,7 @@ void backlight_set_on_button_hold(int index); | |||
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #if defined(HAVE_LCD_SLEEP) && defined(HAVE_LCD_SLEEP_SETTING) | 59 | #if defined(HAVE_LCD_SLEEP) && defined(HAVE_LCD_SLEEP_SETTING) |
60 | void lcd_set_sleep_after_backlight_off(int index); | 60 | void lcd_set_sleep_after_backlight_off(int timeout_seconds); |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #else /* !HAVE_BACKLIGHT */ | 63 | #else /* !HAVE_BACKLIGHT */ |