/
timesetter.c
682 lines (628 loc) · 17 KB
/
timesetter.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
#include "timesetter.h"
#include "timedisplay.h"
#include "timekeeper.h"
#include "time.h"
#include "lcd.h"
#include "dclock.h"
#include "alarm.h"
#include "serial.h"
#include <stdio.h>
static QState initial (struct TimeSetter *me);
static QState top (struct TimeSetter *me);
static QState tempBrightnessState (struct TimeSetter *me);
static QState setTimePauseState (struct TimeSetter *me);
static QState setTimeState (struct TimeSetter *me);
static QState setHoursState (struct TimeSetter *me);
static QState setMinutesState (struct TimeSetter *me);
static QState setSecondsState (struct TimeSetter *me);
static QState setAlarmState (struct TimeSetter *me);
static QState setAlarmPauseState (struct TimeSetter *me);
static QState setAlarmOnOffState (struct TimeSetter *me);
struct TimeSetter timesetter;
Q_DEFINE_THIS_FILE;
void timesetter_ctor(void)
{
QActive_ctor((QActive*)(×etter), (QStateHandler)initial);
timesetter.ready = 0;
timesetter.settingWhich = 0;
}
static QState initial(struct TimeSetter *me)
{
me->ready = 73;
return Q_TRAN(top);
}
static QState top(struct TimeSetter *me)
{
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
me->ready = 73; /* (V)(;,,,;)(V) */
lcd_clear();
return Q_HANDLED();
case BUTTON_SELECT_PRESS_SIGNAL:
if (lcd_get_brightness()) {
return Q_HANDLED();
} else {
return Q_TRAN(tempBrightnessState);
}
case BUTTON_SELECT_RELEASE_SIGNAL:
/* We react to a release signal because we want to distinguish
between a button press and a long press. If we see a
release signal here, that means that we must have had a
short press, otherwise we would have transitioned out of
this state via a long press. */
me->settingWhich = SETTING_ALARM;
return Q_TRAN(setAlarmPauseState);
case BUTTON_SELECT_LONG_PRESS_SIGNAL:
me->settingWhich = SETTING_TIME;
return Q_TRAN(setTimePauseState);
case BUTTON_UP_PRESS_SIGNAL:
case BUTTON_UP_REPEAT_SIGNAL:
lcd_inc_brightness();
return Q_HANDLED();
case BUTTON_DOWN_PRESS_SIGNAL:
case BUTTON_DOWN_REPEAT_SIGNAL:
lcd_dec_brightness();
return Q_HANDLED();
}
return Q_SUPER(&QHsm_top);
}
static QState tempBrightnessState(struct TimeSetter *me)
{
static uint8_t counter;
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
lcd_inc_brightness();
counter = 0;
return Q_HANDLED();
case BUTTON_SELECT_RELEASE_SIGNAL:
return Q_TRAN(top);
case BUTTON_SELECT_LONG_PRESS_SIGNAL:
/* Ignore this signal because it's used by the parent state to
transition somewhere else. */
return Q_HANDLED();
case BUTTON_SELECT_REPEAT_SIGNAL:
switch (counter) {
case 0:
case 32:
case 64:
lcd_inc_brightness();
default:
counter ++;
break;
case 65:
break;
}
return Q_HANDLED();
case Q_EXIT_SIG:
while (lcd_get_brightness()) {
lcd_dec_brightness();
}
return Q_HANDLED();
}
return Q_SUPER(top);
}
static void displayWithTimeout(struct TimeSetter *me, char *line)
{
uint8_t dots;
dots = me->setTimeouts;
Q_ASSERT( dots < 7 );
switch (dots) {
case 6:
line[15] = '.';
line[14] = '.';
line[13] = '.';
break;
case 5:
line[15] = '*';
line[14] = '.';
line[13] = '.';
break;
case 4:
line[14] = '.';
line[13] = '.';
break;
case 3:
line[14] = '*';
line[13] = '.';
break;
case 2:
line[13] = '.';
break;
case 1:
line[13] = '*';
break;
}
Q_ASSERT( line[16] == '\0' );
lcd_line2(line);
}
/**
* Display the current state of what we are setting on the bottom line.
*
* When setting the alarm, display "On" or "OFF", hours, minutes, and countdown
* timer. When setting the time, display blank space, hours, minutes, seconds,
* and countdown timer. The layout is arranged so that the hours and minutes
* appear in the same place on the top line in alarm and time setting.
*/
static void displaySettingTime(struct TimeSetter *me)
{
char line[17];
char separator;
switch (get_time_mode()) {
case NORMAL_MODE:
separator = ':';
break;
case DECIMAL_MODE:
separator = '.';
break;
default:
separator = 0;
Q_ASSERT( 0 );
}
switch (me->settingWhich) {
case SETTING_TIME:
snprintf(line, 17, " %02u%c%02u%c%02u ",
me->setTime[0], separator, me->setTime[1], separator,
me->setTime[2]);
break;
case SETTING_ALARM:
snprintf(line, 17, "%s %02u%c%02u ",
(me->alarmOn ? "On " : "OFF"),
me->setTime[0], separator, me->setTime[1]);
break;
default:
Q_ASSERT( 0 );
}
Q_ASSERT( line[16] == '\0' );
displayWithTimeout(me, line);
}
/**
* Display a string on the top line of the LCD.
*
* The string is stored in ROM.
*/
static void displayMenuName(const char Q_ROM *name)
{
char line[17];
uint8_t i;
char c;
i = 0;
while ( (c=Q_ROM_BYTE(name[i])) ) {
line[i] = c;
i++;
}
Q_ASSERT( i < 16 );
while (i < 16) {
line[i++] = ' ';
}
line[i] = '\0';
Q_ASSERT( line[16] == '\0' );
lcd_line1(line);
}
/** Wait 1.5 seconds in the time setting states between changes of dots. */
#define TSET_TOUT ((37*3)/2)
/** Have six stages of timeout in the time setting states. */
#define N_TSET_TOUTS 6
static QState setState(struct TimeSetter *me)
{
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
post((&timedisplay), SETTING_TIME_SIGNAL, 0);
me->timeSetChanged = 0;
return Q_HANDLED();
case UPDATE_TIME_SET_SIGNAL:
/* We get this whenever the user changes one of the hours,
mintues, or seconds. We have to change the displayed
setting time, reset the timeouts, and re-display the name
and dots. */
me->timeSetChanged = 73; /* Need a true value? Why not 73? */
/* We don't change the signal that QP sends us on timeout,
since the signal is specific to the child set state. */
QActive_arm_sig((QActive*)me, TSET_TOUT, 0);
post(me, UPDATE_TIME_SET_CURSOR_SIGNAL, 0);
return Q_HANDLED();
case BUTTON_SELECT_LONG_PRESS_SIGNAL:
case BUTTON_SELECT_REPEAT_SIGNAL:
case BUTTON_UP_LONG_PRESS_SIGNAL:
case BUTTON_UP_RELEASE_SIGNAL:
case BUTTON_DOWN_LONG_PRESS_SIGNAL:
case BUTTON_DOWN_RELEASE_SIGNAL:
/* Make sure we ignore these button signals, as parent states
may do things with them that will interfere with time
setting. */
return Q_HANDLED();
case BUTTON_SELECT_RELEASE_SIGNAL:
return Q_TRAN(top);
case UPDATE_TIME_TIMEOUT_SIGNAL:
/* Any of our child states can time out. When they do, we get
this signal to tell us that, and we abort the time setting.
The child states use their own signals to do the timeout in
order to avoid a race condition between them with
Q_TIMEOUT_SIG, which is why we don't handle Q_TIMEOUT_SIG
here (except to assert that it shouldn't happen.) */
me->timeSetChanged = 0;
return Q_TRAN(top);
case Q_TIMEOUT_SIG:
Q_ASSERT( 0 );
return Q_HANDLED();
case Q_EXIT_SIG:
post((&timedisplay), SETTING_TIME_FINISHED_SIGNAL, 0);
QActive_disarm((QActive*)me);
LCD_LINE2_ROM(" ");
lcd_cursor_off();
lcd_clear();
return Q_HANDLED();
}
return Q_SUPER(top);
}
/**
* This state is here so we can give the TimeDisplay a moment to stop updating.
*
* The problem is that when we send TimeDisplay a SETTING_TIME_SIGNAL, there
* could already be a tick signal in its queue. So it may overwrite the top
* line of the display after we have written the top line with the menu name.
* But if we wait for one tick here, that gives time for TimeDisplay's queue to
* be processed, including the SETTING_TIME_SIGNAL. So even if there is a tick
* event there, it will be processed before we update the top line.
*/
static QState setTimePauseState(struct TimeSetter *me)
{
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
QActive_arm((QActive*)me, 1);
return Q_HANDLED();
case Q_TIMEOUT_SIG:
return Q_TRAN(setHoursState);
}
return Q_SUPER(setState);
}
static QState setTimeState(struct TimeSetter *me)
{
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
SERIALSTR("> setTimeState\r\n");
get_times(me->setTime);
displaySettingTime(me);
return Q_HANDLED();
case UPDATE_TIME_SET_SIGNAL:
me->setTimeouts = N_TSET_TOUTS;
displaySettingTime(me);
return Q_SUPER(setState);
case Q_EXIT_SIG:
SERIALSTR("< setTimeState");
if (me->timeSetChanged) {
SERIALSTR(" changed\r\n");
set_times(me->setTime);
} else {
SERIALSTR(" no change\r\n");
}
return Q_HANDLED();
}
return Q_SUPER(setState);
}
/**
* @see setTimePauseState()
*/
static QState setAlarmPauseState(struct TimeSetter *me)
{
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
QActive_arm((QActive*)me, 1);
return Q_HANDLED();
case Q_TIMEOUT_SIG:
return Q_TRAN(setAlarmOnOffState);
}
return Q_SUPER(setState);
}
static QState setAlarmOnOffState(struct TimeSetter *me)
{
static const char Q_ROM setAlarmOnOffName[] = "Alarm:";
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
Q_ASSERT( me->settingWhich == SETTING_ALARM );
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_ALARM_TIMEOUT_SIGNAL);
me->setTimeouts = N_TSET_TOUTS;
me->alarmOn = get_alarm_state(&alarm);
displayMenuName(setAlarmOnOffName);
/* We have to get the alarm times here since the hours and
minutes are displayed when we are setting the on/off
state. */
get_alarm_times(&alarm, me->setTime);
displaySettingTime(me);
lcd_set_cursor(1, 0);
return Q_HANDLED();
case UPDATE_TIME_SET_SIGNAL:
me->setTimeouts = N_TSET_TOUTS;
displaySettingTime(me);
return Q_SUPER(setState);
case UPDATE_ALARM_TIMEOUT_SIGNAL:
Q_ASSERT( me->setTimeouts );
me->setTimeouts --;
if (0 == me->setTimeouts) {
post(me, UPDATE_TIME_TIMEOUT_SIGNAL, 0);
} else {
displaySettingTime(me);
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_ALARM_TIMEOUT_SIGNAL);
post(me, UPDATE_TIME_SET_CURSOR_SIGNAL, 0);
}
return Q_HANDLED();
case UPDATE_TIME_SET_CURSOR_SIGNAL:
lcd_set_cursor(1, 0);
return Q_HANDLED();
case BUTTON_UP_PRESS_SIGNAL:
case BUTTON_UP_REPEAT_SIGNAL:
case BUTTON_DOWN_PRESS_SIGNAL:
case BUTTON_DOWN_REPEAT_SIGNAL:
if (me->alarmOn) {
me->alarmOn = 0;
} else {
me->alarmOn = 73;
}
displaySettingTime(me);
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case BUTTON_SELECT_PRESS_SIGNAL:
if (me->alarmOn) {
return Q_TRAN(setHoursState);
} else {
/* The user wants the alarm off. If that's a new
setting, then tell the alarm to go off. */
if (me->timeSetChanged) {
set_alarm_times(&timekeeper, me->setTime, 0);
post(&alarm, ALARM_OFF_SIGNAL, 0);
}
return Q_TRAN(setState);
}
case BUTTON_SELECT_RELEASE_SIGNAL:
return Q_HANDLED();
}
return Q_SUPER(setState);
}
static QState setAlarmState(struct TimeSetter *me)
{
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
SERIALSTR("> setAlarmState\r\n");
displaySettingTime(me);
return Q_HANDLED();
case UPDATE_TIME_SET_SIGNAL:
me->setTimeouts = N_TSET_TOUTS;
displaySettingTime(me);
return Q_SUPER(setState);
case Q_EXIT_SIG:
SERIALSTR("< setAlarmState ");
if (me->timeSetChanged) {
set_alarm_times(&timekeeper, me->setTime, 1);
} else {
if (me->alarmOn) {
SERIALSTR("no change, on\r\n");
} else {
SERIALSTR("no change, off\r\n");
}
}
return Q_HANDLED();
}
return Q_SUPER(setState);
}
/**
* This state has two parent states - setTimeState() and setAlarmState().
*
* The parent state is selected dynamically based on which of the current time
* or the alarm time we are setting right now. That decision is based on
* me->settingWhich, which should not change for the duration of any one time
* setting user operation. settingWhich is set by the code that begins the
* transition to here (in top()), and unset when we exit setState().
*/
static QState setHoursState(struct TimeSetter *me)
{
static const char Q_ROM setTimeHoursName[] = "Set hours:";
static const char Q_ROM setAlarmHoursName[] = "Alarm hours:";
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_HOURS_TIMEOUT_SIGNAL);
me->setTimeouts = N_TSET_TOUTS;
displaySettingTime(me);
switch (me->settingWhich) {
case SETTING_TIME:
displayMenuName(setTimeHoursName);
break;
case SETTING_ALARM:
displayMenuName(setAlarmHoursName);
break;
default:
Q_ASSERT(0);
}
lcd_set_cursor(1, 5);
return Q_HANDLED();
case UPDATE_HOURS_TIMEOUT_SIGNAL:
Q_ASSERT( me->setTimeouts );
me->setTimeouts --;
if (0 == me->setTimeouts) {
post(me, UPDATE_TIME_TIMEOUT_SIGNAL, 0);
} else {
displaySettingTime(me);
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_HOURS_TIMEOUT_SIGNAL);
post(me, UPDATE_TIME_SET_CURSOR_SIGNAL, 0);
}
return Q_HANDLED();
case BUTTON_UP_PRESS_SIGNAL:
case BUTTON_UP_REPEAT_SIGNAL:
me->setTime[0] = inc_hours(me->setTime[0]);
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case BUTTON_DOWN_PRESS_SIGNAL:
case BUTTON_DOWN_REPEAT_SIGNAL:
me->setTime[0] = dec_hours(me->setTime[0]);
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case UPDATE_TIME_SET_CURSOR_SIGNAL:
lcd_set_cursor(1, 5);
return Q_HANDLED();
case BUTTON_SELECT_PRESS_SIGNAL:
return Q_TRAN(setMinutesState);
case BUTTON_SELECT_RELEASE_SIGNAL:
return Q_HANDLED();
}
switch (me->settingWhich) {
case SETTING_TIME:
return Q_SUPER(setTimeState);
case SETTING_ALARM:
return Q_SUPER(setAlarmState);
default:
Q_ASSERT(0);
return Q_SUPER(setTimeState);
}
}
/**
* @see setHoursState()
*/
static QState setMinutesState(struct TimeSetter *me)
{
static const char Q_ROM setTimeMinutesName[] = "Set minutes:";
static const char Q_ROM setAlarmMinutesName[] = "Alarm minutes:";
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_MINUTES_TIMEOUT_SIGNAL);
me->setTimeouts = N_TSET_TOUTS;
displaySettingTime(me);
switch (me->settingWhich) {
case SETTING_TIME:
displayMenuName(setTimeMinutesName);
break;
case SETTING_ALARM:
displayMenuName(setAlarmMinutesName);
break;
default:
Q_ASSERT(0);
}
lcd_set_cursor(1, 8);
return Q_HANDLED();
case UPDATE_MINUTES_TIMEOUT_SIGNAL:
Q_ASSERT( me->setTimeouts );
me->setTimeouts --;
if (0 == me->setTimeouts) {
post(me, UPDATE_TIME_TIMEOUT_SIGNAL, 0);
} else {
displaySettingTime(me);
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_MINUTES_TIMEOUT_SIGNAL);
post(me, UPDATE_TIME_SET_CURSOR_SIGNAL, 0);
}
return Q_HANDLED();
case BUTTON_UP_PRESS_SIGNAL:
case BUTTON_UP_REPEAT_SIGNAL:
me->setTime[1] = inc_minutes(me->setTime[1]);
if (SETTING_ALARM == me->settingWhich) {
while (me->setTime[1] % 5) {
me->setTime[1] = inc_minutes(me->setTime[1]);
}
}
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case BUTTON_DOWN_PRESS_SIGNAL:
case BUTTON_DOWN_REPEAT_SIGNAL:
me->setTime[1] = dec_minutes(me->setTime[1]);
if (SETTING_ALARM == me->settingWhich) {
while (me->setTime[1] % 5) {
me->setTime[1] = dec_minutes(me->setTime[1]);
}
}
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case UPDATE_TIME_SET_CURSOR_SIGNAL:
lcd_set_cursor(1, 8);
return Q_HANDLED();
case BUTTON_SELECT_PRESS_SIGNAL:
switch (me->settingWhich) {
case SETTING_TIME:
return Q_TRAN(setSecondsState);
case SETTING_ALARM:
/* We don't set the seconds on the alarm, so don't
transition to that state. */
return Q_TRAN(setState);
default:
Q_ASSERT( 0 );
break;
}
case BUTTON_SELECT_RELEASE_SIGNAL:
return Q_HANDLED();
}
switch (me->settingWhich) {
case SETTING_TIME:
return Q_SUPER(setTimeState);
case SETTING_ALARM:
return Q_SUPER(setAlarmState);
default:
Q_ASSERT(0);
return Q_SUPER(setTimeState);
}
}
/**
* @see setHoursState()
*/
static QState setSecondsState(struct TimeSetter *me)
{
static const char Q_ROM setTimeSecondsName[] = "Set seconds:";
static const char Q_ROM setAlarmSecondsName[] = "Alarm seconds:";
switch (Q_SIG(me)) {
case Q_ENTRY_SIG:
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_SECONDS_TIMEOUT_SIGNAL);
me->setTimeouts = N_TSET_TOUTS;
displaySettingTime(me);
switch (me->settingWhich) {
case SETTING_TIME:
displayMenuName(setTimeSecondsName);
break;
case SETTING_ALARM:
displayMenuName(setAlarmSecondsName);
break;
default:
Q_ASSERT(0);
}
lcd_set_cursor(1, 11);
return Q_HANDLED();
case UPDATE_SECONDS_TIMEOUT_SIGNAL:
Q_ASSERT( me->setTimeouts );
me->setTimeouts --;
if (0 == me->setTimeouts) {
post(me, UPDATE_TIME_TIMEOUT_SIGNAL, 0);
} else {
displaySettingTime(me);
QActive_arm_sig((QActive*)me, TSET_TOUT,
UPDATE_SECONDS_TIMEOUT_SIGNAL);
post(me, UPDATE_TIME_SET_CURSOR_SIGNAL, 0);
}
return Q_HANDLED();
case BUTTON_UP_PRESS_SIGNAL:
case BUTTON_UP_REPEAT_SIGNAL:
me->setTime[2] = inc_seconds(me->setTime[2]);
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case BUTTON_DOWN_PRESS_SIGNAL:
case BUTTON_DOWN_REPEAT_SIGNAL:
me->setTime[2] = dec_seconds(me->setTime[2]);
post(me, UPDATE_TIME_SET_SIGNAL, 0);
return Q_HANDLED();
case UPDATE_TIME_SET_CURSOR_SIGNAL:
lcd_set_cursor(1, 11);
return Q_HANDLED();
case BUTTON_SELECT_PRESS_SIGNAL:
return Q_TRAN(setState);
case BUTTON_SELECT_RELEASE_SIGNAL:
return Q_HANDLED();
}
switch (me->settingWhich) {
case SETTING_TIME:
return Q_SUPER(setTimeState);
case SETTING_ALARM:
return Q_SUPER(setAlarmState);
default:
Q_ASSERT(0);
return Q_SUPER(setTimeState);
}
}