Repository navigation
fix: separate ADC source offsets from buffer destinations (fixes #303) - #322
abdulhamid999 wants to merge 1 commit into
Conversation
Reviewer's GuideImplementationSeparate the input-data offset from the hardware destination index so nonzero starting positions still send every sample.
TestsAdd regression tests for chunked writes at nonzero destinations, the zero-destination command sequence, and empty input.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Linked issuesChecked at commit 6471593 #303 ADC buffer writes skip input values at nonzero destinations · 2 of 2 met
|
Fixes #303.
Problem
ADCBufferMixin.fill_buffer() previously used the device buffer destination index (idx = starting_position) to slice the input Python data list (data[idx : idx + samps]). When starting_position > 0, the first input values were skipped and if starting_position >= len(data), zero values were sent while the hardware command still declared the full sample count, causing the firmware to block waiting for payload words that were never sent.
Solution
Decouple the Python data array source offset from the hardware destination position:
Testing
Added hardware-independent regression tests in tests/test_buffer_fill.py covering:
Summary by Sourcery
Ensure ADC buffer destination offsets are independent from input data offsets while preserving existing command behavior.
Bug Fixes:
Tests:
Summary by CodeRabbit