Skip to content

Commit 5381c62

Browse files
authored
fix check no_of_samples
changed at row 204 from if timebase_options.no_of_samples is not None and timebase_options.no_of_samples > max_samples_possible: to if timebase_options.no_of_samples is not None and timebase_options.no_of_samples > max_samples_possible.value: the check to calculate timebase while requesting a fixed number of samples is not correct
1 parent 97c73f0 commit 5381c62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

picosdk/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def capture_block(self, timebase_options, channel_configs=()):
201201
# always force the number of memory segments on the device to 1 before computing timebases for a one-off
202202
# block capture.
203203
max_samples_possible = self.driver.memory_segments(self, USE_SEGMENT_ID+1)
204-
if timebase_options.no_of_samples is not None and timebase_options.no_of_samples > max_samples_possible:
204+
if timebase_options.no_of_samples is not None and timebase_options.no_of_samples > max_samples_possible.value:
205205
raise NoValidTimebaseForOptionsError()
206206
except DeviceCannotSegmentMemoryError:
207207
pass

0 commit comments

Comments
 (0)