diff --git a/example/rp2040_embassy/.cargo/config.toml b/examples/rp2040_embassy/.cargo/config.toml similarity index 100% rename from example/rp2040_embassy/.cargo/config.toml rename to examples/rp2040_embassy/.cargo/config.toml diff --git a/example/rp2040_embassy/.gitignore b/examples/rp2040_embassy/.gitignore similarity index 100% rename from example/rp2040_embassy/.gitignore rename to examples/rp2040_embassy/.gitignore diff --git a/example/rp2040_embassy/Cargo.lock b/examples/rp2040_embassy/Cargo.lock similarity index 100% rename from example/rp2040_embassy/Cargo.lock rename to examples/rp2040_embassy/Cargo.lock diff --git a/example/rp2040_embassy/Cargo.toml b/examples/rp2040_embassy/Cargo.toml similarity index 100% rename from example/rp2040_embassy/Cargo.toml rename to examples/rp2040_embassy/Cargo.toml diff --git a/example/rp2040_embassy/build.rs b/examples/rp2040_embassy/build.rs similarity index 100% rename from example/rp2040_embassy/build.rs rename to examples/rp2040_embassy/build.rs diff --git a/example/rp2040_embassy/memory.x b/examples/rp2040_embassy/memory.x similarity index 100% rename from example/rp2040_embassy/memory.x rename to examples/rp2040_embassy/memory.x diff --git a/example/rp2040_embassy/src/main.rs b/examples/rp2040_embassy/src/main.rs similarity index 88% rename from example/rp2040_embassy/src/main.rs rename to examples/rp2040_embassy/src/main.rs index 75639be..ea20395 100644 --- a/example/rp2040_embassy/src/main.rs +++ b/examples/rp2040_embassy/src/main.rs @@ -39,20 +39,20 @@ async fn main(spawner: Spawner) { let sda = p.PIN_4; let scl = p.PIN_5; - let i2c = I2c::new_async(p.I2C0, scl, sda, Irqs, i2c::Config::default()); + let i2c = I2c::new_blocking(p.I2C0, scl, sda, i2c::Config::default()); let mut device = MMC56X3::new(i2c, Delay); - if let Err(e) = device.init().await { + if let Err(e) = device.init() { error!("Failed to init {:?}", e); reboot().await; }; - if let Err(e) = device.set_data_rate(mmc56x3::DataRate::Max1000Hz).await { + if let Err(e) = device.set_data_rate(mmc56x3::DataRate::Max1000Hz) { error!("Failed to set data rate {:?}", e); reboot().await; } - if let Err(e) = device.set_continuous_mode(true).await { + if let Err(e) = device.set_continuous_mode(true) { error!("Failed to set_continuous_mode {:?}", e); reboot().await; } @@ -67,7 +67,7 @@ async fn main(spawner: Spawner) { // .await // .expect("Failed to trigger trigger_messurement"); - match device.read_messurement().await { + match device.read_messurement() { Ok(d) => info!("Got: {:?}", d), Err(e) => error!("Error: {:?}", e), }