Repository navigation
Conversation
count_clock() claims three state machines one by one, and each claim could land on a different PIO, but all three wrote the same dmd_pio. read_clock_count() then read and released all three counters on that last PIO: the detection read a state machine that never counted and failed, and the counters on the other PIO stayed claimed and running. This happens when another user already holds state machines, e.g. the HUB75 driver with two chains plus WS2812 strips on a PPUCDMD: the first detection always failed and the DMD came up a retry (about 1s) later. Store each counter's PIO in spi_pio/dmd_pio/frame_pio, next to the state machines and offsets the counters already reuse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The frame detection starts the reader through a PIO IRQ, and PIO IRQs only reach state machines of the same PIO. Both were claimed one by one, so they could land on different PIOs: the reader then waited for an IRQ that never came and no frame was read. Before the previous commit the counters a failed detection left behind happened to fill the PIO that would have split them. Now that they are released, a PPUCDMD with two HUB75 chains and speaker lights put the reader and the frame detection on different PIOs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
count_clock() claims three state machines one by one, and each claim could land on a different PIO, but all three wrote the same dmd_pio. read_clock_count() then read and released all three counters on that last PIO: the detection read a state machine that never counted and failed, and the counters on the other PIO stayed claimed and running.
This happens when another piece of code already holds state machines, e.g. the HUB75 driver with two chains plus stripes on a PPUCDMD: the first detection always failed and the DMD came up a retry (about 1s) later.
Store each counter's PIO in spi_pio/dmd_pio/frame_pio, next to the state machines and offsets the counters already reuse.