Write captured samples to file in the FFT viewer - #220
Open
dmitrymmm wants to merge 1 commit into
Open
Conversation
The capture loop filled the buffer but no code ever wrote it to the selected file, and the shared sample counters advanced inside the per channel loop, corrupting two channel captures. Write the samples as tab separated text when the requested count is reached and stop the capture. Fixes myriadrf#126 Co-Authored-By: Claude Fable 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.
The FFT viewer capture loop filled captureBuffer but no code ever wrote it to the file chosen in the save dialog, so the capture silently produced nothing and never finished. The shared sample counters also advanced inside the per channel loop, corrupting two channel captures.
The samples are now written as tab separated text (AI AQ, plus BI BQ for two channels) once the requested count is reached, and the capture stops.
Verified the exact old and new logic in a standalone harness with synthetic two channel data arriving in uneven chunks: the old code corrupted the channel data and wrote nothing, the fixed code writes every value correctly. A quick run with a board would be a welcome confirmation, streaming in the viewer needs a device.
Fixes #126
🤖 Generated with Claude Code