Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions omotion/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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"),
)

Expand Down
4 changes: 3 additions & 1 deletion tests/test_trigger_limits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)


Expand Down
Loading