Remove tokio dependency
This commit is contained in:
parent
6c6ab0e2d7
commit
27cc7e38dd
2 changed files with 2 additions and 4 deletions
red
|
@ -13,5 +13,3 @@ i2c-linux = "0.1.2"
|
|||
lazy_static = "1.4.0"
|
||||
regex = "1.6.0"
|
||||
serialport = "4.6.1"
|
||||
tokio = { version = "1.21.0", features = ["full"] }
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ const I2C_REGISTER_SPINDLE_SPEED: u8 = 0;
|
|||
// SMBUS_I2C_BLOCK
|
||||
// SMBUS_EMUL
|
||||
|
||||
pub async fn write_to_spindle() -> Never {
|
||||
pub fn write_to_spindle() -> Never {
|
||||
let mut i2c = I2c::from_path("/dev/i2c-0").unwrap();
|
||||
let mut value = 0;
|
||||
println!("functionality: {:?}", i2c.i2c_functionality());
|
||||
|
@ -38,6 +38,6 @@ pub async fn write_to_spindle() -> Never {
|
|||
Ok(()) => println!("Wrote {} successfully", value),
|
||||
Err(e) => println!("Error writing to device: {}", e),
|
||||
};
|
||||
tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
std::thread::sleep(Duration::from_secs(1));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue