mirror of
https://github.com/anklimov/lighthub
synced 2025-12-07 04:09:49 +03:00
Refactored core fix
This commit is contained in:
@@ -641,16 +641,22 @@ if (newState!=store->state && cause!=CHECK_INTERRUPT) debugSerial<<F("#")<<pin<<
|
||||
else
|
||||
{
|
||||
//Postpone actual execution
|
||||
store->reqState=newState;
|
||||
store->delayedState=true;
|
||||
if (newState != store->state)
|
||||
{
|
||||
store->reqState=newState;
|
||||
store->delayedState=true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static volatile uint8_t contactPollBusy = 0;
|
||||
|
||||
void Input::contactPoll(short cause) {
|
||||
boolean currentInputState;
|
||||
if (!store) return;
|
||||
if (!store || contactPollBusy) return;
|
||||
contactPollBusy++;
|
||||
|
||||
changeState(IS_REQSTATE,cause); //Check for postponed states transitions
|
||||
|
||||
@@ -853,6 +859,7 @@ if (cause != CHECK_INTERRUPT) switch (store->state) //Timer based transitions
|
||||
}
|
||||
} else // no change
|
||||
store->bounce = SAME_STATE_ATTEMPTS;
|
||||
contactPollBusy--;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user