summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/sleeptimer.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/apps/sleeptimer.c b/apps/sleeptimer.c
index 15a2f7c656..1a6e3ec844 100644
--- a/apps/sleeptimer.c
+++ b/apps/sleeptimer.c
@@ -30,6 +30,7 @@
30#include "powermgmt.h" 30#include "powermgmt.h"
31#include "status.h" 31#include "status.h"
32#include "debug.h" 32#include "debug.h"
33#include "talk.h"
33 34
34#include "lang.h" 35#include "lang.h"
35 36
@@ -52,6 +53,7 @@ bool sleeptimer_screen(void)
52 int amount = 0; 53 int amount = 0;
53 int org_timer=get_sleep_timer(); 54 int org_timer=get_sleep_timer();
54 bool changed=false; 55 bool changed=false;
56 bool sayit = true;
55 57
56#ifdef HAVE_LCD_BITMAP 58#ifdef HAVE_LCD_BITMAP
57 lcd_setfont(FONT_UI); 59 lcd_setfont(FONT_UI);
@@ -107,7 +109,7 @@ bool sleeptimer_screen(void)
107 if(newtime > MAX_TIME) 109 if(newtime > MAX_TIME)
108 newtime = MAX_TIME; 110 newtime = MAX_TIME;
109 111
110 changed=true; 112 changed = sayit = true;
111 set_sleep_timer(newtime); 113 set_sleep_timer(newtime);
112 break; 114 break;
113 115
@@ -126,7 +128,7 @@ bool sleeptimer_screen(void)
126 if(newtime < 0) 128 if(newtime < 0)
127 newtime = 0; 129 newtime = 0;
128 130
129 changed=true; 131 changed = sayit = true;
130 set_sleep_timer(newtime); 132 set_sleep_timer(newtime);
131 break; 133 break;
132 } 134 }
@@ -141,10 +143,32 @@ bool sleeptimer_screen(void)
141 snprintf(buf, 32, "%d:%02d", 143 snprintf(buf, 32, "%d:%02d",
142 hours, minutes); 144 hours, minutes);
143 lcd_puts(0, 1, buf); 145 lcd_puts(0, 1, buf);
146
147 if (sayit)
148 {
149 bool enqueue = false; /* first one should not ne queued */
150
151 if (hours)
152 {
153 talk_value(hours, UNIT_HOUR, enqueue);
154 enqueue = true; /* queue any following */
155 }
156 if (minutes)
157 {
158 talk_value(minutes, UNIT_MIN, enqueue);
159 }
160
161 sayit = false;
162 }
144 } 163 }
145 else 164 else
146 { 165 {
147 lcd_puts(0, 1, str(LANG_OFF)); 166 lcd_puts(0, 1, str(LANG_OFF));
167 if (sayit)
168 {
169 talk_id(LANG_OFF, false);
170 sayit = false;
171 }
148 } 172 }
149 173
150 status_draw(true); 174 status_draw(true);