[WARN] Static hold state in updateHold() persists across state changes #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
DoorbellLogic::updateHold()uses static variablesholdStartXandholdStartYthat persist across loop iterations and state transitions.If
updateHold()is called when not in ALERTING state, stale values remain and could cause phantom hold detection when returning to ALERTING state.Affected file:
libraries/KlubhausCore/src/DoorbellLogic.cppline ~104Fix
Reset the static holdStart coordinates when leaving ALERTING state, or use member variables instead of static variables.