From d522fac9b82607370758ae70b02015a3b34a8495 Mon Sep 17 00:00:00 2001 From: Blizzard Finnegan Date: Mon, 19 Jun 2023 15:09:56 -0400 Subject: [PATCH] Move iteration count ask to beginning of loop --- src/main.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index 70ec3ec..ff5ab88 100755 --- a/src/main.rs +++ b/src/main.rs @@ -56,6 +56,16 @@ fn main(){ log::debug!("Debug enabled!"); } loop{ + let mut iteration_count:u64 = 0; + if args.debug { + iteration_count = 10000; + } + else { + while iteration_count < 1{ + iteration_count = int_input_filtering(Some("Enter the number of iterations to complete: ")); + } + } + let gpio = &mut GpioPins::new(); match std::fs::read_dir("/dev/serial/by-path"){ Ok(available_ttys)=>{ @@ -128,16 +138,6 @@ fn main(){ } } - let mut iteration_count:u64 = 0; - if args.debug { - iteration_count = 10000; - } - else { - while iteration_count < 1{ - iteration_count = int_input_filtering(Some("Enter the number of iterations to complete: ")); - } - } - let mut iteration_threads = Vec::new(); while let Some(mut device) = devices.pop(){ iteration_threads.push(thread::spawn(move||{