Compare commits

...

2 commits

Author SHA1 Message Date
8fbdddda38 Upgrade rust edition 2025-02-21 23:04:21 +01:00
27cc7e38dd Remove tokio dependency 2025-02-21 23:04:12 +01:00
2 changed files with 3 additions and 5 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "red"
version = "0.1.0"
edition = "2021"
edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -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"] }

View file

@ -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));
}
}