File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -545,21 +545,25 @@ class AudioKitStream : public AudioStreamX {
545
545
546
546
// pin conflicts with AIThinker A101 and headphone detection
547
547
if (! (cfg.sd_active && AUDIOKIT_BOARD==6 )) {
548
- actions.add (kit.pinHeadphoneDetect (), actionHeadphoneDetection);
548
+ LOGD (" actionHeadphoneDetection pin:%d" ,kit.pinHeadphoneDetect ())
549
+ actions.add (kit.pinHeadphoneDetect (), actionHeadphoneDetection, AudioActions::ActiveChange);
549
550
} else {
550
551
LOGW (" Headphone detection ignored because of conflict: %d " ,kit.pinHeadphoneDetect ());
551
552
}
552
553
553
554
// pin conflicts with the SD CS pin for AIThinker and buttons
554
555
if (! (cfg.sd_active && (AUDIOKIT_BOARD==5 || AUDIOKIT_BOARD==6 ))){
556
+ LOGD (" actionStartStop" )
555
557
addAction (kit.pinInputMode (), actionStartStop);
556
558
} else {
557
559
LOGW (" Mode Button ignored because of conflict: %d " ,kit.pinInputMode ());
558
560
}
559
561
560
562
// pin conflicts with SD Lyrat SD CS Pin and buttons
561
563
if (! (cfg.sd_active && AUDIOKIT_BOARD==1 )){
564
+ LOGD (" actionVolumeDown" )
562
565
addAction (kit.pinVolumeDown (), actionVolumeDown);
566
+ LOGD (" actionVolumeUp" )
563
567
addAction (kit.pinVolumeUp (), actionVolumeUp);
564
568
} else {
565
569
LOGW (" Volume Buttons ignored because of conflict: %d " ,kit.pinVolumeDown ());
Original file line number Diff line number Diff line change @@ -108,11 +108,12 @@ class AudioActions {
108
108
} else if (a->activeLogic == ActiveChange) {
109
109
bool active = (a->activeLogic == ActiveLow) ? !value : value;
110
110
// reports pin state
111
- if (value != a->lastState ) {
111
+ if (value != a->lastState && millis () > a-> debounceTimeout ) {
112
112
// LOGI("processActions: ActiveChange");
113
113
// execute action
114
114
a->actionOn (active, a->pin , a->ref );
115
115
a->lastState = value;
116
+ a->debounceTimeout = millis () + DEBOUNCE_DELAY;
116
117
}
117
118
} else {
118
119
bool active = (a->activeLogic == ActiveLow) ? !value : value;
You can’t perform that action at this time.
0 commit comments