Commit 5adddf41ffb957c1cf1af8070051689dc789b3b7
1 parent
87a2b633
Fixed 9-bit data conversion for normal mode
Showing
1 changed file
with
1 additions
and
1 deletions
openhantek/src/hantek/control.cpp
| ... | ... | @@ -416,7 +416,7 @@ namespace Hantek { |
| 416 | 416 | if(bufferPosition >= dataCount) |
| 417 | 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 | 422 | else { | ... | ... |