mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 22:02:17 +01:00
fix: wait out a remote's long press across the millis() wrap
The 500 ms wait that tells a short press from a long one compared now > await, so a press just before the wrap acted at once. It now compares the wrap-safe difference. Reconcile Q21 in SHADE_BEHAVIOUR_PLAN.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
4eff50645d
commit
7220f38fcd
3 changed files with 15 additions and 2 deletions
|
|
@ -360,7 +360,8 @@ void ShadeBehaviour::onWaitingFrame(uint32_t now) {
|
|||
return;
|
||||
}
|
||||
if(this->lastFrame.processed) return;
|
||||
if(this->lastFrame.await > 0 && (now > this->lastFrame.await)) {
|
||||
// Wrap-safe: await is now + 500 when the press began.
|
||||
if(this->lastFrame.await > 0 && static_cast<int32_t>(now - this->lastFrame.await) > 0) {
|
||||
somfy_commands cmd = this->transformCommand(this->lastFrame.cmd);
|
||||
switch(cmd) {
|
||||
case somfy_commands::StepUp:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue