From 5adddf41ffb957c1cf1af8070051689dc789b3b7 Mon Sep 17 00:00:00 2001 From: oliverhaag Date: Tue, 21 Sep 2010 20:09:59 +0000 Subject: [PATCH] Fixed 9-bit data conversion for normal mode --- openhantek/src/hantek/control.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhantek/src/hantek/control.cpp b/openhantek/src/hantek/control.cpp index 4f5ff99..d12cf8c 100644 --- a/openhantek/src/hantek/control.cpp +++ b/openhantek/src/hantek/control.cpp @@ -416,7 +416,7 @@ namespace Hantek { if(bufferPosition >= dataCount) bufferPosition %= dataCount; - this->samples[channel][realPosition] = ((double) (data[bufferPosition + HANTEK_CHANNELS - 1 - channel] + (data[dataCount + bufferPosition + HANTEK_CHANNELS - 1 - channel] << 8)) / 0x1ff - this->offsetReal[channel]) * this->gainSteps[this->gain[channel]]; + this->samples[channel][realPosition] = ((double) ((unsigned short int) data[bufferPosition + HANTEK_CHANNELS - 1 - channel] + ((unsigned short int) data[dataCount + bufferPosition + HANTEK_CHANNELS - 1 - channel] << 8)) / 0x1ff - this->offsetReal[channel]) * this->gainSteps[this->gain[channel]]; } } else { -- libgit2 0.21.4