Merge pull request #605 from gedankenexperimenter/bug/oneshot-timeout

Fix OneShot premature timeout
pull/609/head
Gergely Nagy 6 years ago committed by GitHub
commit 79c1f75624
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -173,7 +173,14 @@ EventHandlerResult OneShot::beforeReportingState() {
} }
EventHandlerResult OneShot::afterEachCycle() { EventHandlerResult OneShot::afterEachCycle() {
if (hasTimedOut()) bool oneshot_active = false;
for (uint8_t i = 0; i < ONESHOT_KEY_COUNT; i++) {
if (state_[i].active) {
oneshot_active = true;
break;
}
}
if (oneshot_active && hasTimedOut())
cancel(); cancel();
bool is_cancelled = false; bool is_cancelled = false;

Loading…
Cancel
Save