Merge pull request #16229 from stefanbode/patch-8

Stop shutter after longpress of buttons
This commit is contained in:
Theo Arends 2022-08-15 22:43:25 +02:00 committed by GitHub
commit 2eafac3eeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -853,6 +853,12 @@ void ShutterButtonHandler(void)
}
if (NOT_PRESSED == button) {
if (Shutter[shutter_index].direction && Button.hold_timer[button_index] > 0) {
XdrvMailbox.index = shutter_index +1;
XdrvMailbox.payload = XdrvMailbox.index;
//AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Shtr%d, Button %d, hold %d, dir %d, index %d, payload %d"), shutter_index+1, button_index+1, Button.hold_timer[button_index],Shutter[shutter_index].direction,XdrvMailbox.index,XdrvMailbox.payload);
CmndShutterStop();
}
Button.hold_timer[button_index] = 0;
} else {
Button.hold_timer[button_index]++;