Skip to content

Commit

Permalink
prevent using both averaging and segmenting
Browse files Browse the repository at this point in the history
  • Loading branch information
jebej committed Nov 13, 2023
1 parent ce32b05 commit c4cc7c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ function list_boards()
end
end

function configure_for_ttl_triggering(boardnum,clock=1,channels=3;num_seg=0,seg_len=8192)
function configure_for_ttl_triggering(boardnum,clock=1,channels=3;num_seg=0,seg_len=8192,num_avg=0,avg_len=8192)
setup_board(boardnum)
set_clock(boardnum,clock)
set_channels(boardnum,3) # needed to make sure clock is updated properly when moving to single channel mode
set_channels(boardnum,channels)
set_trigger(boardnum,4,1)
# only one of num_seg or num_avg can be nonzero
if num_seg != 0 && num_avg != 0
throw(ArgumentError("only one of num_seg or num_avg can be nonzero"))
end
# if num_seg == 0, segmented capture is disabled
set_segmented_capture(boardnum,num_seg,seg_len)
# if num_avg == 0, averaging is disabled
set_averager(boardnum,num_avg,avg_len)
end

function configure_for_waveform_triggering(boardnum,clock=1,channels=3,trig_ch=1,thresh=2^11,hyst=128;num_avg=0,avg_len=8192)
Expand Down

0 comments on commit c4cc7c3

Please sign in to comment.