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||{