Started to work on pedal_operations

Created a seperate struct for the pedals. Write functions are still empty. Later, I'll move the read function to this struct too.
This commit is contained in:
2018-07-18 14:26:11 +02:00
parent a8169788c5
commit b2a026e5e0
2 changed files with 67 additions and 3 deletions

View File

@@ -3,6 +3,7 @@
//! `footswitch-rs` enables you to use footswitches of <xxx>
mod key_operations;
mod pedal_operations;
#[macro_use]
extern crate structopt;
@@ -30,8 +31,9 @@ struct Opt {
output: Option<PathBuf>,
}
fn main() {
let pedals = pedal_operations::Pedals::new();
println!("{:?}", pedals.ped_data[1].length);
check_sudo();
let opt = Opt::from_args();
@@ -81,6 +83,7 @@ fn check_sudo() {
}
/// Read the current values of the pedals
//ToDo: Move to pedals struct and split read and interpret functionality
fn read_pedals(dev: & hidapi::HidDevice) {
let column_width = 15;
let total_width = (column_width+3)*3;
@@ -111,5 +114,4 @@ fn read_pedals(dev: & hidapi::HidDevice) {
// Print simple footer
println!("\n {}", "-".repeat(total_width));
}
}