From 7d34f4d2c8e3ae63f7f217be7700d20e5c8823a7 Mon Sep 17 00:00:00 2001 From: Brent Stapleton Date: Fri, 21 Dec 2018 10:27:42 -0800 Subject: examples: formatting in tx_waveforms - Format `if` statements to multiple lines - Add quick comment on the exit checks --- host/examples/tx_waveforms.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'host/examples') diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index a002720ee..d5e4cb6f5 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -241,8 +241,14 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ uint64_t num_acc_samps = 0; while(true){ - if (stop_signal_called) break; - if (total_num_samps > 0 and num_acc_samps >= total_num_samps) break; + // Break on the end of duration or CTRL-C + if (stop_signal_called) { + break; + } + // Break when we've received nsamps + if (total_num_samps > 0 and num_acc_samps >= total_num_samps) { + break; + } //fill the buffer with the waveform for (size_t n = 0; n < buff.size(); n++){ -- cgit v1.2.3