Commit 57e0bebcc1d4cf99d70071eae48604149332abd3
Committed by
David Gräff
1 parent
9935f0a6
Use actual data returned from the cmdGetLimits.
Fixes #158
Showing
3 changed files
with
2 additions
and
4 deletions
openhantek/src/hantekdso/hantekdsocontrol.cpp
| ... | ... | @@ -135,7 +135,7 @@ Dso::ErrorCode HantekDsoControl::retrieveChannelLevelData() { |
| 135 | 135 | return Dso::ErrorCode::CONNECTION; |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - memcpy(controlsettings.offsetLimit, controlsettings.cmdGetLimits.offsetLimitData(), | |
| 138 | + memcpy(controlsettings.offsetLimit, controlsettings.cmdGetLimits.data(), | |
| 139 | 139 | sizeof(OffsetsPerGainStep) * specification->channels); |
| 140 | 140 | |
| 141 | 141 | return Dso::ErrorCode::NONE; | ... | ... |
openhantek/src/hantekprotocol/controlStructs.cpp
| ... | ... | @@ -130,7 +130,7 @@ ControlAcquireHardData::ControlAcquireHardData() : ControlCommand(ControlCode::C |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | ControlGetLimits::ControlGetLimits(size_t channels) |
| 133 | - : ControlCommand(ControlCode::CONTROL_VALUE, 1), offsetLimit(new OffsetsPerGainStep[channels]) { | |
| 133 | + : ControlCommand(ControlCode::CONTROL_VALUE, sizeof(OffsetsPerGainStep)*channels) { | |
| 134 | 134 | value = (uint8_t)ControlValue::VALUE_OFFSETLIMITS; |
| 135 | 135 | data()[0] = 0x01; |
| 136 | 136 | } | ... | ... |
openhantek/src/hantekprotocol/controlStructs.h
| ... | ... | @@ -129,8 +129,6 @@ struct ControlAcquireHardData : public ControlCommand { |
| 129 | 129 | }; |
| 130 | 130 | |
| 131 | 131 | struct ControlGetLimits : public ControlCommand { |
| 132 | - std::unique_ptr<OffsetsPerGainStep[]> offsetLimit; | |
| 133 | 132 | ControlGetLimits(size_t channels); |
| 134 | - inline uint8_t *offsetLimitData() { return (uint8_t *)offsetLimit.get(); } | |
| 135 | 133 | }; |
| 136 | 134 | } | ... | ... |