-
Notifications
You must be signed in to change notification settings - Fork 43
/
Buttons.cpp
622 lines (592 loc) · 19.4 KB
/
Buttons.cpp
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
/*
* Buttons.c
*
* Created on: 21 Octber 2016
* author: Sebastien CAPOU ([email protected]) and Andras Kun ([email protected])
* Source : https://github.com/Protonerd/FX-SaberOS
://github.com/neskweek/LightSaberOS
*/
#include "Buttons.h"
#include "Config_HW.h"
#include "Config_SW.h"
#include "Soundfont.h"
#include "Light.h"
#include "ConfigMenu.h"
extern SoundFont soundFont;
// global Saber state and Sub State variables
extern SaberStateEnum SaberState;
extern SaberStateEnum PrevSaberState;
extern ActionModeSubStatesEnum ActionModeSubStates;
extern ConfigModeSubStatesEnum ConfigModeSubStates;
extern ActionModeSubStatesEnum PrevActionModeSubStates;
extern ConfigModeSubStatesEnum PrevConfigModeSubStates;
//extern SubStateEnum SubState;
extern unsigned long sndSuppress;
extern bool hum_playing;
extern int8_t modification;
extern bool play;
extern int16_t value;
#ifdef JUKEBOX
extern bool jukebox_play;
extern uint8_t jb_track;
#endif
extern bool lockuponclash;
extern bool tipmeltonclash;
extern bool changeMenu;
extern uint8_t menu;
extern bool enterMenu;
#if defined LEDSTRINGS
extern uint8_t ledPins[];
#endif
#if defined STAR_LED
extern uint8_t ledPins[];
extern cRGB currentColor;
//extern uint8_t currentColor[4]; //0:Red 1:Green 2:Blue 3:ColorID
#endif
#if defined PIXELBLADE or defined ADF_PIXIE_BLADE
extern uint8_t ledPins[];
extern cRGB color;
extern cRGB currentColor;
#endif
extern void HumRelaunch();
extern void SinglePlay_Sound(uint16_t track);
extern void LoopPlay_Sound(uint16_t track);
extern void Pause_Sound();
extern void Resume_Sound();
extern void Set_Loop_Playback();
extern void Set_Volume(int8_t volumeSet);
extern void Disable_FTDI(bool ftdi_off);
extern void Disable_MP3(bool mp3_off);
extern void confParseValue(uint16_t variable, uint16_t min, uint16_t max,
short int multiplier);
extern uint8_t GravityVector();
extern void FX_BlasterBlock();
bool quickselect_active=false;
extern struct StoreStruct {
// This is for mere detection if they are our settings
char version[5];
// The settings
uint8_t volume;// 0 to 31
uint8_t soundFont;// as many as Sound font you have defined in Soundfont.h Max:253
struct Profile {
cRGB mainColor;
cRGB clashColor;
cRGB blasterboltColor;
uint16_t swingSensitivity;
uint8_t flickerType;
uint8_t poweronoffType;
}sndProfile[SOUNDFONT_QUANTITY];
}storage;
extern bool fireblade;
// ====================================================================================
// === BUTTONS CALLBACK FUNCTIONS ===
// ====================================================================================
void ConfigMenuButtonEventHandler(bool SaturateColor, ButtonActionEnum ButtonActionType, int8_t incrementSign=1){
if (ConfigModeSubStates == CS_VOLUME and ButtonActionType==SINGLE_CLICK) {
play = true;
confParseValue(storage.volume, 0, 30, 1*incrementSign);
storage.volume = value;
BladeMeter(ledPins, value*100/30);
Set_Volume(storage.volume);
#if defined LS_INFO
Serial.println(storage.volume);
#endif
}
else if (ConfigModeSubStates == CS_SOUNDFONT and ButtonActionType==SINGLE_CLICK) {
play = false;
confParseValue(storage.soundFont, 0, SOUNDFONT_QUANTITY - 1, 1*incrementSign);
storage.soundFont = value;
soundFont.setID(value);
#if defined PIXELBLADE
if (storage.sndProfile[storage.soundFont].flickerType==2 or storage.sndProfile[storage.soundFont].flickerType==3 or storage.sndProfile[storage.soundFont].flickerType==4) {fireblade=true;}
else {fireblade=false;}
#endif
SinglePlay_Sound(soundFont.getMenu((storage.soundFont)*NR_FILE_SF));
//Serial.print("soundfont "); Serial.print(storage.soundFont); Serial.print(" Offset: ");Serial.println(soundFont.getMenu((storage.soundFont)*NR_FILE_SF));
delay(150);
}
#if defined PIXELBLADE or defined STAR_LED or defined ADF_PIXIE_BLADE
else if (ConfigModeSubStates==CS_MAINCOLOR) {
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].mainColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
if (ButtonActionType==SINGLE_CLICK){
confParseValue(modification, 0, 14, incrementSign);
modification = value;
getColorFix(modification);
}
#endif
storage.sndProfile[storage.soundFont].mainColor.r=currentColor.r;
storage.sndProfile[storage.soundFont].mainColor.g=currentColor.g;
storage.sndProfile[storage.soundFont].mainColor.b=currentColor.b;
lightOn(ledPins, -1, currentColor, NUMPIXELS/2, NUMPIXELS-6);
delay(50);
}
else if (ConfigModeSubStates==CS_CLASHCOLOR) {
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].clashColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
if (ButtonActionType==SINGLE_CLICK){
confParseValue(modification, 0, 14, incrementSign);
modification = value;
getColorFix(modification);
}
#endif
storage.sndProfile[storage.soundFont].clashColor.r=currentColor.r;
storage.sndProfile[storage.soundFont].clashColor.g=currentColor.g;
storage.sndProfile[storage.soundFont].clashColor.b=currentColor.b;
lightOn(ledPins, -1, currentColor, 1, NUMPIXELS/2-1);
delay(50);
}
else if (ConfigModeSubStates==CS_BLASTCOLOR) {
#ifdef GRAVITY_COLOR
ColorMixing(storage.sndProfile[storage.soundFont].blasterboltColor,modification,MAX_BRIGHTNESS, SaturateColor);
#else if COLOR_PROFILE
if (ButtonActionType==SINGLE_CLICK){
confParseValue(modification, 0, 14, incrementSign);
modification = value;
getColorFix(modification);
}
#endif
storage.sndProfile[storage.soundFont].blasterboltColor.r=currentColor.r;
storage.sndProfile[storage.soundFont].blasterboltColor.g=currentColor.g;
storage.sndProfile[storage.soundFont].blasterboltColor.b=currentColor.b;
lightOn(ledPins, -1, currentColor, NUMPIXELS*3/4-5, NUMPIXELS*3/4);
delay(50);
}
#endif // PIXELBLADE or STAR_LED
else if (ConfigModeSubStates == CS_FLICKERTYPE and ButtonActionType==SINGLE_CLICK) {
#ifdef LEDSTRINGS
confParseValue(storage.sndProfile[storage.soundFont].flickerType, 0, 2, 1*incrementSign); // max number of flicker types for LEDSTRINGS currently 3
#endif
#ifdef STAR_LED
confParseValue(storage.sndProfile[storage.soundFont].flickerType, 0, 2, 1*incrementSign); // max number of flicker types for STAR_LED currently 3
#endif
#ifdef ADF_PIXIE_BLADE
confParseValue(storage.sndProfile[storage.soundFont].flickerType, 0, 0, 1*incrementSign); // max number of flicker types for Adafruit Pixie currently 1
#endif
#ifdef PIXELBLADE
confParseValue(storage.sndProfile[storage.soundFont].flickerType, 0, 4, 1*incrementSign); // max number of flicker types for PIXELBLADE currently 5
#endif
storage.sndProfile[storage.soundFont].flickerType = value;
#if defined PIXELBLADE
if (value==2 or value==3 or value==4) {fireblade=true;}
else {fireblade=false;}
#endif
#if defined LS_INFO
Serial.println(storage.sndProfile[storage.soundFont].flickerType);
#endif
}
else if (ConfigModeSubStates == CS_SWINGSENSITIVITY and ButtonActionType==SINGLE_CLICK) {
// 2048LSB/g, -32k to +32k, but usable range is ~16384(=1g acceleration), increment with 1/100th of a g
confParseValue(storage.sndProfile[storage.soundFont].swingSensitivity, 0, 16000, 160*incrementSign);
storage.sndProfile[storage.soundFont].swingSensitivity = value;
#if defined LS_INFO
Serial.println(storage.sndProfile[storage.soundFont].swingSensitivity);
#endif
BladeMeter(ledPins, (storage.sndProfile[storage.soundFont].swingSensitivity)/100);
}
}
void QuickSelectButtonEventHandler(){
quickselect_active=true;
}
void mainClick() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Main button click."));
#endif
if (SaberState==S_SABERON) {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start motion triggered blaster bolt deflect"));
#endif
if (ActionModeSubStates==AS_HUM) { // start motion triggered blaster deflect
ActionModeSubStates=AS_BLASTERDEFLECTMOTION;
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start motion triggered blaster bolt deflect"));
#endif
FX_BlasterBlock();
}
else if (ActionModeSubStates==AS_BLASTERDEFLECTMOTION) { // stop motion triggered blaster deflect
#if defined LS_BUTTON_DEBUG
Serial.println(F("End motion triggered blaster bolt deflect"));
#endif
HumRelaunch();
ActionModeSubStates=AS_HUM;
accentLEDControl(AL_ON);
}
if (lockuponclash or tipmeltonclash) {
HumRelaunch();
ActionModeSubStates = AS_HUM;
lockuponclash=false;
tipmeltonclash=false;
#if defined LS_BUTTON_DEBUG
Serial.println(F("End clash triggered lockup/tipmelt (either pre or active phase)"));
#endif
}
}
else if (SaberState==S_CONFIG) {
#ifdef DEEP_SLEEP
if (ConfigModeSubStates==CS_SLEEPINIT) {
SaberState=S_SLEEP;
PrevSaberState=S_CONFIG;
// play a beep 3 times
SinglePlay_Sound(1);
delay(500);
SinglePlay_Sound(1);
delay(500);
SinglePlay_Sound(1);
delay(500);
}
#endif // DEEP_SLEEP
if (ConfigModeSubStates != CS_FLICKERTYPE) {
SinglePlay_Sound(1);
delay(50);
}
ConfigMenuButtonEventHandler(true, SINGLE_CLICK);
}
else if (SaberState==S_STANDBY) {
// LightSaber poweron
SaberState=S_SABERON;
PrevSaberState=S_STANDBY;
ActionModeSubStates=AS_IGNITION;
//actionMode = true;
}
#ifdef JUKEBOX
else if (SaberState==S_JUKEBOX) {
#ifdef SINGLEBUTTON
#if defined LS_BUTTON_DEBUG
Serial.print(F("Play/Pause current song "));Serial.print(jb_track);
#endif
if (jukebox_play) {
// pause the song
#if defined LS_BUTTON_DEBUG
Serial.println(F("Pause Song"));
#endif
jukebox_play=false;
Pause_Sound();
} else {
// resume playing the song
#if defined LS_BUTTON_DEBUG
Serial.println(F("Resume Song"));
#endif
jukebox_play=true;
Resume_Sound();
}
#else // two button setup (main + aux)
#if defined LS_BUTTON_DEBUG
Serial.print(F("Next JukeBox sound file "));Serial.print(jb_track);
#endif // jump to next song and start playing it
if (jb_track==NR_CONFIGFOLDERFILES+NR_JUKEBOXSONGS) {
jb_track=NR_CONFIGFOLDERFILES+1; // fold back to first song in the dir designated for music playback
}
else {
jb_track++;
}
SinglePlay_Sound(jb_track);
#endif // SINGLEBUTTON
}
#endif // JUKEBOX
} // mainClick
void mainDoubleClick() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Main button double click."));
#endif
#ifdef SINGLEBUTTON
if (SaberState==S_SABERON) {
if (lockuponclash or tipmeltonclash) {
HumRelaunch();
ActionModeSubStates = AS_HUM;
lockuponclash=false;
tipmeltonclash=false;
#if defined LS_BUTTON_DEBUG
Serial.println(F("End clash triggered lockup/tipmelt (either pre or active phase)"));
#endif
}
else if (ActionModeSubStates == AS_HUM) {
lockuponclash=true;
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start clash triggered lockup (either pre or active phase)"));
#endif
}
} else if (SaberState==S_CONFIG) {
// Change Menu
NextConfigState();
}
#ifdef JUKEBOX
else if (SaberState==S_STANDBY) {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Enter JukeBox"));
#endif
SaberState=S_JUKEBOX;
PrevSaberState=S_STANDBY;
//ACTION TO DEFINE
} else if (SaberState==S_JUKEBOX) {
//Entering JukeBox mode (MP3 player)
SaberState=S_STANDBY;
PrevSaberState=S_JUKEBOX;
// stop/pause track being played
Pause_Sound();
}
#endif // JUKEBOX
#else // not SINGLEBUTTON
#ifdef TIP_MELT
if (SaberState==S_SABERON) {
if (lockuponclash or tipmeltonclash) {
HumRelaunch();
ActionModeSubStates = AS_HUM;
lockuponclash=false;
tipmeltonclash=false;
#if defined LS_BUTTON_DEBUG
Serial.println(F("End clash triggered lockup/tipmelt (either pre or active phase)"));
#endif
}
else if (ActionModeSubStates == AS_HUM) {
tipmeltonclash=true;
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start clash triggered tipmelt"));
#endif
}
}
#endif // TIP_MELT
#endif // SINGLEBUTTON
} // mainDoubleClick
void mainMultiClick() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Main button multi click."));
#endif
#ifdef SINGLEBUTTON
#ifdef TIP_MELT
if (SaberState==S_SABERON) {
if (lockuponclash or tipmeltonclash) {
HumRelaunch();
ActionModeSubStates = AS_HUM;
lockuponclash=false;
tipmeltonclash=false;
#if defined LS_BUTTON_DEBUG
Serial.println(F("End clash triggered lockup/tipmelt (either pre or active phase)"));
#endif
}
else if (ActionModeSubStates == AS_HUM) {
tipmeltonclash=true;
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start clash triggered tipmelt"));
#endif
}
}
#endif // TIP_MELT
#endif // SINGLEBUTTON
} // mainMultiClick
void mainLongPressStart() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Main button longPress start"));
#endif
if (SaberState==S_SABERON) {
// LightSaber switch-off
ActionModeSubStates=AS_RETRACTION;
SaberState=S_STANDBY;
PrevSaberState=S_SABERON;
lockuponclash = false;
tipmeltonclash = false;
} else if (SaberState==S_CONFIG) {
#ifndef SINGLEBUTTON
// Change Menu
NextConfigState();
#else // SINGLEBUTTON
//Leaving Config Mode
#ifdef GRAVITY_COLOR // only in case of Gravity Color Mix do not allow exit config mode upon long press
if (ConfigModeSubStates!=CS_MAINCOLOR and ConfigModeSubStates!=CS_CLASHCOLOR and ConfigModeSubStates!=CS_BLASTCOLOR) {
#endif // GRAVITY_COLOR
changeMenu = false;
SaberState=S_STANDBY;
PrevSaberState=S_CONFIG;
#ifdef PIXELBLADE
pixelblade_KillKey_Disable();
#endif
Set_Volume(storage.volume);
delay(200);
#ifdef GRAVITY_COLOR
}
#endif // GRAVITY_COLOR
#endif // SINGLEBUTTON
}
#ifdef SINGLEBUTTON
#ifdef JUKEBOX
else if (SaberState==S_JUKEBOX) {
#if defined LS_BUTTON_DEBUG
Serial.print(F("Next JukeBox sound file "));Serial.print(jb_track);
#endif // jump to next song and start playing it
if (jb_track==NR_CONFIGFOLDERFILES+NR_JUKEBOXSONGS) {
jb_track=NR_CONFIGFOLDERFILES+1; // fold back to first song in the dir designated for music playback
}
else {
jb_track++;
}
SinglePlay_Sound(jb_track);
}
#endif // JUKEBOX
#endif // SINGLEBUTTON
#ifdef SINGLEBUTTON
else if (SaberState==S_STANDBY) {
if (not quickselect_active) {
//Entering Config Mode
SaberState=S_CONFIG;
PrevSaberState=S_STANDBY;
#ifdef PIXELBLADE
pixelblade_KillKey_Enable();
#endif
}
}
#endif
} // mainLongPressStart
void mainLongPress() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Main button longPress..."));
#endif
if (SaberState==S_SABERON) {
} else if (SaberState==S_CONFIG) {
ConfigMenuButtonEventHandler(false, LONGPRESS);
}
else if (SaberState==S_STANDBY) {
/*
* ACTION TO DEFINE
*/
}
} // mainLongPress
void mainLongPressStop() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Main button longPress stop"));
#endif
quickselect_active=false;
} // mainLongPressStop
#ifndef SINGLEBUTTON
void lockupClick() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Lockup button click."));
#endif
if (SaberState==S_SABERON) {
// Blaster bolt deflect
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start button activated blaster bolt deflect"));
#endif
ActionModeSubStates=AS_BLASTERDEFLECTPRESS;
} else if (SaberState==S_CONFIG) {
if (ConfigModeSubStates != CS_FLICKERTYPE) {
SinglePlay_Sound(2);
delay(50);
}
ConfigMenuButtonEventHandler(true, SINGLE_CLICK,-1);
}
#ifdef JUKEBOX
else if (SaberState==S_JUKEBOX) {
if (jukebox_play) {
// pause the song
#if defined LS_BUTTON_DEBUG
Serial.println(F("Pause Song"));
#endif
jukebox_play=false;
Pause_Sound();
} else {
// resume playing the song
#if defined LS_BUTTON_DEBUG
Serial.println(F("Resume Song"));
#endif
jukebox_play=true;
Resume_Sound();
}
}
#endif // JUKEBOX
} // lockupClick
void lockupDoubleClick() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Lockup button double click."));
#endif
if (SaberState==S_SABERON) {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start motion triggered blaster bolt deflect"));
#endif
if (lockuponclash or tipmeltonclash) {
HumRelaunch();
ActionModeSubStates = AS_HUM;
lockuponclash=false;
tipmeltonclash=false;
#if defined LS_BUTTON_DEBUG
Serial.println(F("End clash triggered lockup (either pre or active phase)"));
#endif
}
else {
lockuponclash=true;
#if defined LS_BUTTON_DEBUG
Serial.println(F("Start clash triggered lockup (either pre or active phase)"));
#endif
}
}
#ifdef JUKEBOX
else if (SaberState==S_STANDBY) {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Enter JukeBox"));
#endif
SaberState=S_JUKEBOX;
PrevSaberState=S_STANDBY;
//ACTION TO DEFINE
} else if (SaberState==S_JUKEBOX) {
//Entering JukeBox mode (MP3 player)
SaberState=S_STANDBY;
PrevSaberState=S_JUKEBOX;
// stop/pause track being played
Pause_Sound();
}
#endif // JUKEBOX
} // lockupDoubleClick
void lockupLongPressStart() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Lockup button longPress start"));
#endif
if (SaberState==S_SABERON) {
//Lockup Start
ActionModeSubStates=AS_BLADELOCKUP;
if (soundFont.getLockup((storage.soundFont)*NR_FILE_SF)) {
LoopPlay_Sound(soundFont.getLockup((storage.soundFont)*NR_FILE_SF));
}
} else if (SaberState==S_CONFIG) {
if (ConfigModeSubStates!=CS_MAINCOLOR and ConfigModeSubStates!=CS_CLASHCOLOR and ConfigModeSubStates!=CS_BLASTCOLOR) {
//Leaving Config Mode
changeMenu = false;
// repeat = true;
SaberState=S_STANDBY;
PrevSaberState=S_CONFIG;
Set_Volume(storage.volume);
delay(200); }
} else if (SaberState==S_STANDBY) {
//Entering Config Mode
SaberState=S_CONFIG;
PrevSaberState=S_STANDBY;
}
} // lockupLongPressStart
void lockupLongPress() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Lockup button longPress..."));
#endif
if (SaberState==S_SABERON) {
/*
* ACTION TO DEFINE
*/
ActionModeSubStates=AS_BLADELOCKUP; // needed, otherwise the FSM will change to AS_HUM and the lockup will end prematurely when the hum is relaunched
sndSuppress = millis(); // trick the hum relaunch by starting the stopper all over again otherwise the hum relaunch will interrupt the lockup
}
else if (SaberState==S_CONFIG) {
ConfigMenuButtonEventHandler(false, LONGPRESS);
} else if (SaberState==S_STANDBY) {
/*
* ACTION TO DEFINE
*/
}
} // lockupLongPress
void lockupLongPressStop() {
#if defined LS_BUTTON_DEBUG
Serial.println(F("Lockup button longPress stop"));
#endif
if (SaberState==S_SABERON) {
HumRelaunch();
ActionModeSubStates=AS_HUM;
}
} // lockupLongPressStop
#endif // SINGLEBUTTON not defined