Keep Ford AOL armed through the Cancel safety echo

This commit is contained in:
firestar5683
2026-11-22 22:02:26 -06:00
parent e366cb0170
commit 0972ef0d44
3 changed files with 19 additions and 2 deletions
@@ -159,6 +159,22 @@ def test_repeated_cancel_does_not_refresh_original_source_or_native_deadlines():
assert native.validUntilMonoTime == NOW+200_000_000
@pytest.mark.parametrize('event_matches, expired', [(True, False), (False, False), (True, True)])
def test_cancel_echo_uses_the_original_event_and_native_deadline(event_matches, expired):
cp, cs, feedback, sm, native, now = fixture()
assert not invoke(cp, cs, feedback, sm, now)
stamp = native.observedMonoTime + (201 if expired else 106) * 1_000_000
next_sample = sample(cp, stamp, 3, native, combined=False)
event_ns = sm.logMonoTime['onroadEvents']
next_sample.messages['onroadEvents'] = sm.messages['onroadEvents']
next_sample.logMonoTime['onroadEvents'] = event_ns
if event_matches:
change(next_sample, 'aolAxisState', lambda axis: setattr(axis, 'faultEventMonoTime', event_ns))
assert invoke(cp, cs, feedback, next_sample, stamp + 1_000_000) == (not event_matches or expired)
assert next_sample.logMonoTime['onroadEvents'] == event_ns
assert native.validUntilMonoTime == NOW + 200_000_000
def test_fresh_native_receipts_allow_repeated_cancel_and_new_full_engagement():
cp, cs, f, sm, native, now = fixture()
assert not invoke(cp, cs, f, sm, now)
+2 -1
View File
@@ -273,7 +273,8 @@ class TransportPauseFeedback:
# Cancel needs acknowledged LAT, original deadlines and a fresh withdrawal event.
ford_cancel_health = bool(ford_withdrawal and not cs.cruiseState.enabled and
not axis.desiredLongitudinal and not axis.longitudinalActive and
0 < event_ns <= now_ns and now_ns - event_ns <= AXIS_MAX_AGE_NS and
0 < event_ns <= now_ns and (now_ns - event_ns <= AXIS_MAX_AGE_NS or
native is not None and native.observedMonoTime < event_ns == axis.faultEventMonoTime <= axis.observedMonoTime) and
any(event.userDisable and event.name in (log.OnroadEvent.EventName.buttonCancel,
log.OnroadEvent.EventName.pcmDisable) for event in sm['onroadEvents']) and
0 < int(sm.logMonoTime['pandaStates']) <= now_ns and
+1 -1
View File
@@ -1 +1 @@
{"protected_inventory_sha256": "bbe7c779fc19df3fd9767340c8b26913636b33a687074e33f3f4a8cde4071627", "schema_version": 1}
{"protected_inventory_sha256": "016119aa7d76dbfa133750b4e89537de8eee348a61e9a45fd08a091c87c9260c", "schema_version": 1}