Skip to content

Commit e8b4dd0

Browse files
committed
remove cloning of arbitrary waveform, and a todo
1 parent 74a0ddb commit e8b4dd0

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

driver/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ pub trait PicoDriver: fmt::Debug + Send + Sync {
205205
_stop_delta_phase: u32,
206206
_delta_phase_increment: u32,
207207
_dwell_count: u32,
208-
_arbitrary_waveform: &Vec<i16>,
208+
_arbitrary_waveform: &mut Vec<i16>,
209209
_sweep_type: PicoSweepType,
210210
_operation: PicoExtraOperations,
211211
_index_mode: PicoIndexMode,

driver/src/ps2000a.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl PicoDriver for PS2000ADriver {
364364
stop_delta_phase: u32,
365365
delta_phase_increment: u32,
366366
dwell_count: u32,
367-
arbitrary_waveform: &Vec<i16>,
367+
arbitrary_waveform: &mut Vec<i16>,
368368
sweep_type: PicoSweepType,
369369
operation: PicoExtraOperations,
370370
index_mode: PicoIndexMode,
@@ -373,11 +373,6 @@ impl PicoDriver for PS2000ADriver {
373373
trigger_source: PicoSigGenTrigSource,
374374
ext_in_threshold: i16,
375375
) -> PicoResult<()> {
376-
// TODO: no idea how to do this better
377-
// to avoid the data being taken away, store a copy here?
378-
// go read the SDK to see if the memory is caller responsibility or
379-
// copied by the library.
380-
let mut arbitrary_waveform = arbitrary_waveform.clone();
381376
PicoStatus::from(unsafe {
382377
self.bindings.ps2000aSetSigGenArbitrary(
383378
handle,

streaming/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ impl PicoStreamingDevice {
679679
#[tracing::instrument(skip(self), level = "trace")]
680680
pub fn set_sig_gen_arbitrary(
681681
&self,
682-
props: SetSigGenArbitraryProperties,
682+
mut props: SetSigGenArbitraryProperties,
683683
) -> PicoResult<()> {
684684
// Start an AWG function
685685
let current_state = self.current_state.write();
@@ -730,7 +730,7 @@ impl PicoStreamingDevice {
730730
stop_delta_phase,
731731
delta_phase_increment,
732732
dwell_count,
733-
&props.arbitrary_waveform,
733+
&mut props.arbitrary_waveform,
734734
props.sweep_type,
735735
props.extra_operations,
736736
index_mode,

0 commit comments

Comments
 (0)