mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-04 14:25:08 +00:00
fix(display): Vegas resumes after live priority, and six smaller runtime fixes (#644)
- Vegas: a live-priority pause was only lifted from inside run_frame(), which returns before that check while paused, so the ticker never came back until a restart. run_iteration() now resumes it (the controller only calls it when nothing preempts Vegas); start()/stop() clear the pause state. Iteration length is timed with the monotonic clock. - Dim schedule: a per-day disabled day now updates the minute-gate cache, so brightness no longer flips back to dim within each minute. - On-demand: a second request no longer overwrites the rotation resume index with the first request's mode. - Render pipeline: reset() drops the prepared group and deferred queue, and a prefetch in flight across a reset discards its result. - Sync: stop() removes the status file (and the controller's cleanup now calls it), standalone removes a stale one at startup, and writes use a unique mkstemp temp file. - render_gate.swap_releases_gil() delegates to frame_timing. - Stale docstrings/comments corrected. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -430,3 +430,25 @@ class TestVegasWiring:
|
||||
pipeline._prefetch_thread.join(5)
|
||||
assert seen == [(True, True)]
|
||||
assert pipeline._prepared_group == ["segment"]
|
||||
|
||||
|
||||
class TestBindingCheck:
|
||||
"""swap_releases_gil() is frame_timing's check, not a second copy of it."""
|
||||
|
||||
@pytest.mark.parametrize("contents, expected", [
|
||||
(b"...PyEval_SaveThread...", True),
|
||||
(b"stock binding", False),
|
||||
])
|
||||
def test_agrees_with_frame_timing(self, monkeypatch, tmp_path, contents, expected):
|
||||
from types import SimpleNamespace
|
||||
from src.common import frame_timing
|
||||
binding = tmp_path / "core.so"
|
||||
binding.write_bytes(contents)
|
||||
monkeypatch.setitem(sys.modules, "rgbmatrix.core",
|
||||
SimpleNamespace(__file__=str(binding)))
|
||||
assert render_gate.swap_releases_gil() is expected
|
||||
assert frame_timing.binding_releases_gil() is expected
|
||||
|
||||
def test_none_without_a_binding(self, monkeypatch):
|
||||
monkeypatch.delitem(sys.modules, "rgbmatrix.core", raising=False)
|
||||
assert render_gate.swap_releases_gil() is None
|
||||
|
||||
Reference in New Issue
Block a user