From 66cd7c3d7b0f45236f472c39dfc16a4e4335a20b Mon Sep 17 00:00:00 2001 From: George Vigelette Date: Thu, 15 Oct 2026 01:39:21 -0400 Subject: [PATCH] fix(console): name the safety-limits START refusal (0x20) Console firmware with CFW-10 (console-fw fix/safety-limits-validate) refuses OW_CTRL_START_TRIG with status bit 0x20 when a safety limit named in the stored config was not loaded and verified (out of range, not a settable register, failed write or read-back mismatch). It clears on the next config apply that succeeds. Add TRIG_INTERLOCK_LIMITS (0x20) and its reason, so start_trigger() and ScanWorkflow report "a safety limit in the console config was not applied (out of range or failed read-back)". Tests: tests/test_trigger_limits.py; software suite no new failures. Bench: config with EE_PULSE_WIDTH_UL 700 -> start_trigger() False, refusal 0x20 with the reason above; stored config restored -> True. Signed-off-by: George Vigelette --- omotion/config.py | 5 +++++ tests/test_trigger_limits.py | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/omotion/config.py b/omotion/config.py index 4fc8ed89..17f6f58d 100644 --- a/omotion/config.py +++ b/omotion/config.py @@ -406,6 +406,10 @@ def merge_trigger_config(*overrides) -> dict: # EE or OPT safety FPGA STATUS could not be read for several polls in a row # (console-fw CFW-04). Clears once both read again with no fault. TRIG_INTERLOCK_SAFETY_UNKNOWN: int = 0x10 +# A safety limit named in the stored config was not loaded and verified: out of +# range, not a settable register, write failed or read back wrong (console-fw +# CFW-10). Cleared by the next config apply that succeeds. +TRIG_INTERLOCK_LIMITS: int = 0x20 TRIG_START_TIMER_FAILED: int = 0x80 _TRIG_REFUSAL_REASONS = ( @@ -414,6 +418,7 @@ def merge_trigger_config(*overrides) -> dict: (TRIG_INTERLOCK_TEC, "TEC thermal trip (clears about 5 s after the TEC recovers)"), (TRIG_INTERLOCK_CONFIG, "console user config invalid or missing; running on defaults until a config is written"), (TRIG_INTERLOCK_SAFETY_UNKNOWN, "laser-safety FPGA status unreadable (EE/OPT not responding)"), + (TRIG_INTERLOCK_LIMITS, "a safety limit in the console config was not applied (out of range or failed read-back)"), (TRIG_START_TIMER_FAILED, "FSYNC timer failed to start"), ) diff --git a/tests/test_trigger_limits.py b/tests/test_trigger_limits.py index 91f3a37e..a39b126f 100644 --- a/tests/test_trigger_limits.py +++ b/tests/test_trigger_limits.py @@ -23,6 +23,7 @@ TRIG_INTERLOCK_CONFIG, TRIG_INTERLOCK_LASER_SAFETY, TRIG_INTERLOCK_SAFETY_UNKNOWN, + TRIG_INTERLOCK_LIMITS, TRIG_INTERLOCK_TEC, TRIG_START_TIMER_FAILED, TRIGGER_JSON_MAX, @@ -126,7 +127,8 @@ def test_describe_trigger_refusal(): assert "config invalid or missing" in describe_trigger_refusal(TRIG_INTERLOCK_CONFIG) assert "unknown" not in describe_trigger_refusal(TRIG_INTERLOCK_CONFIG | TRIG_INTERLOCK_TEC) assert "unreadable" in describe_trigger_refusal(TRIG_INTERLOCK_SAFETY_UNKNOWN) - assert "0x20" in describe_trigger_refusal(0x20) + assert "safety limit" in describe_trigger_refusal(TRIG_INTERLOCK_LIMITS) + assert "0x40" in describe_trigger_refusal(0x40) assert "no status byte" in describe_trigger_refusal(None)