Skip to content

Commit 7862387

Browse files
Winged UnicornDavid Gräff
authored andcommitted
Fix the [no] downsampler border case for DSO 2250.
downsampler == 1 means divide by one => no downsampling, use the base clocks. On 2250, frequency divider is a 16-bit up-counter. It outputs a pulse on overflow when enabled and reloads the value which was passed in the ESETTRIGGERORSAMPLERATE command. If you enable downsampler with ESETTRIGGERORSAMPLERATE and: - write 0xffff as a counter (0x10001 - 2), it will divide by 2 - write 0xfffe as a counter (0x10001 - 3), it will divide by 3 .... - write 0x0001 as a counter (0x10001 - 0), it will divide by 65535 - write 0x0000 as a counter (0x10001 - 1), it will divide by 65536 Fixes #81
1 parent ff3bb8f commit 7862387

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openhantek/src/hantekdso/hantekdsocontrol.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,11 @@ unsigned HantekDsoControl::updateSamplerate(unsigned downsampler, bool fastRate)
531531
BulkSetSamplerate2250 *commandSetSamplerate2250 =
532532
modifyCommand<BulkSetSamplerate2250>(BulkCode::ESETTRIGGERORSAMPLERATE);
533533

534-
bool downsampling = downsampler >= 1;
534+
bool downsampling = downsampler > 1;
535535
// Store downsampler state value
536536
commandSetSamplerate2250->setDownsampling(downsampling);
537537
// Store samplerate value
538-
commandSetSamplerate2250->setSamplerate(downsampler > 1 ? 0x10001 - downsampler : 0);
538+
commandSetSamplerate2250->setSamplerate(downsampling ? 0x10001 - downsampler : 0);
539539
// Set fast rate when used
540540
commandSetSamplerate2250->setFastRate(fastRate);
541541

0 commit comments

Comments
 (0)