Skip to content

Commit 57e0beb

Browse files
Winged UnicornDavid Gräff
authored andcommitted
Use actual data returned from the cmdGetLimits.
Fixes #158
1 parent 9935f0a commit 57e0beb

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

openhantek/src/hantekdso/hantekdsocontrol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Dso::ErrorCode HantekDsoControl::retrieveChannelLevelData() {
135135
return Dso::ErrorCode::CONNECTION;
136136
}
137137

138-
memcpy(controlsettings.offsetLimit, controlsettings.cmdGetLimits.offsetLimitData(),
138+
memcpy(controlsettings.offsetLimit, controlsettings.cmdGetLimits.data(),
139139
sizeof(OffsetsPerGainStep) * specification->channels);
140140

141141
return Dso::ErrorCode::NONE;

openhantek/src/hantekprotocol/controlStructs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ControlAcquireHardData::ControlAcquireHardData() : ControlCommand(ControlCode::C
130130
}
131131

132132
ControlGetLimits::ControlGetLimits(size_t channels)
133-
: ControlCommand(ControlCode::CONTROL_VALUE, 1), offsetLimit(new OffsetsPerGainStep[channels]) {
133+
: ControlCommand(ControlCode::CONTROL_VALUE, sizeof(OffsetsPerGainStep)*channels) {
134134
value = (uint8_t)ControlValue::VALUE_OFFSETLIMITS;
135135
data()[0] = 0x01;
136136
}

openhantek/src/hantekprotocol/controlStructs.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ struct ControlAcquireHardData : public ControlCommand {
129129
};
130130

131131
struct ControlGetLimits : public ControlCommand {
132-
std::unique_ptr<OffsetsPerGainStep[]> offsetLimit;
133132
ControlGetLimits(size_t channels);
134-
inline uint8_t *offsetLimitData() { return (uint8_t *)offsetLimit.get(); }
135133
};
136134
}

0 commit comments

Comments
 (0)