diff --git a/src/lib/bus/spans.test.ts b/src/lib/bus/spans.test.ts index 45c5204..7430623 100644 --- a/src/lib/bus/spans.test.ts +++ b/src/lib/bus/spans.test.ts @@ -252,7 +252,8 @@ test("limitText names what governs, lowest first", () => { expect(limitText(1 << 0)).toBe("Current limit"); expect(limitText((1 << 1) | (1 << 2))).toBe("Stall yield, End stop"); expect(limitText((1 << 0) | (1 << 3))).toBe("Current limit, Stall permit"); - expect(limitText(1 << 6)).toBe("Limit 0x40"); + expect(limitText((1 << 4) | (1 << 6))).toBe("I2t budget, Rail fold"); + expect(limitText(1 << 8)).toBe("Limit 0x100"); }); test("windowFloorText is percent of full duty, or not reported at zero", () => { diff --git a/src/lib/bus/spans.ts b/src/lib/bus/spans.ts index e601fd3..ce75dd8 100644 --- a/src/lib/bus/spans.ts +++ b/src/lib/bus/spans.ts @@ -267,7 +267,16 @@ export function faultText(faultFlags: number, faultCode: number): string | undef } /** `limit_flags` bits (firmware kernel/limits.rs), lowest bit first. */ -const LIMITS: readonly string[] = ["Current limit", "Stall yield", "End stop", "Stall permit"]; +const LIMITS: readonly string[] = [ + "Current limit", + "Stall yield", + "End stop", + "Stall permit", + "I2t budget", + "Thermal derate", + "Rail fold", + "Goal current", +]; export function limitText(limitFlags: number): string { const set = LIMITS.filter((_, bit) => (limitFlags & (1 << bit)) !== 0);