From 74106084ed94668f11777f856e9b42e80b5d6599 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 11 Nov 2011 11:55:04 -0800 Subject: uhd: simplification for tx waveforms --- host/examples/tx_waveforms.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'host/examples') diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 181c34d05..2a3d9f8e5 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -75,9 +75,8 @@ public: } } - inline std::complex operator()(size_t &index) const{ - index %= wave_table_len; - return _wave_table[index]; + inline std::complex operator()(const size_t index) const{ + return _wave_table[index % wave_table_len]; } private: @@ -241,8 +240,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ while(not stop_signal_called){ //fill the buffer with the waveform for (size_t n = 0; n < buff.size(); n++){ - buff[n] = wave_table(index); - index += step; + buff[n] = wave_table(index += step); } //send the entire contents of the buffer -- cgit v1.2.3