tof: reopen the sensor when it answers polls but never produces a frame - #272
Open
hadelan wants to merge 1 commit into
Open
tof: reopen the sensor when it answers polls but never produces a frame#272hadelan wants to merge 1 commit into
hadelan wants to merge 1 commit into
Conversation
A wedged ranging engine still ACKs the bus, so data_ready succeeds and answers false forever: the daemon streamed silence for the rest of the boot and nothing ever re-opened the sensor. Put a clock on the answer — no frame for a few frame periods (2 s at the shipped 15 Hz, scaled so --hz 1 gets the same margin in frames) breaks the poll loop into the existing backoff-and-reopen path. Armed at open, so a sensor that never produces a first frame is reopened on the same bound.
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.
A wedged ranging engine still ACKs the I²C bus, so
data_readysucceeds and answersfalseforever:tofdstreams silence for the rest of the boot and nothing ever re-opens the sensor. The only "sensor is gone" signal today is a failed transaction, and this failure never produces one.Put a clock on the answer: no frame for a few frame periods (2 s at the shipped 15 Hz, scaled so
--hz 1gets the same margin in frames) breaks the poll loop into the existing backoff-and-reopen path. Armed at open, so a sensor that never produces a first frame is reopened on the same bound.Regression test pins the watchdog scaling.
cargo test -p tof,clippy -D warnings,fmt --checkall green.