Commit 5adddf41ffb957c1cf1af8070051689dc789b3b7

Authored by oliverhaag
1 parent 87a2b633

Fixed 9-bit data conversion for normal mode

openhantek/src/hantek/control.cpp
@@ -416,7 +416,7 @@ namespace Hantek { @@ -416,7 +416,7 @@ namespace Hantek {
416 if(bufferPosition >= dataCount) 416 if(bufferPosition >= dataCount)
417 bufferPosition %= dataCount; 417 bufferPosition %= dataCount;
418 418
419 - 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]]; 419 + 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]];
420 } 420 }
421 } 421 }
422 else { 422 else {