Move iteration count ask to beginning of loop
This commit is contained in:
parent
f1d8af8e3d
commit
d522fac9b8
1 changed files with 10 additions and 10 deletions
20
src/main.rs
20
src/main.rs
|
@ -56,6 +56,16 @@ fn main(){
|
||||||
log::debug!("Debug enabled!");
|
log::debug!("Debug enabled!");
|
||||||
}
|
}
|
||||||
loop{
|
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();
|
let gpio = &mut GpioPins::new();
|
||||||
match std::fs::read_dir("/dev/serial/by-path"){
|
match std::fs::read_dir("/dev/serial/by-path"){
|
||||||
Ok(available_ttys)=>{
|
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();
|
let mut iteration_threads = Vec::new();
|
||||||
while let Some(mut device) = devices.pop(){
|
while let Some(mut device) = devices.pop(){
|
||||||
iteration_threads.push(thread::spawn(move||{
|
iteration_threads.push(thread::spawn(move||{
|
||||||
|
|
Loading…
Add table
Reference in a new issue