From 49788c53640e363d44ad1e78b1abec0961a606ab Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Tue, 2 Mar 2021 21:10:45 +0100 Subject: Update embassy --- examples/src/bin/flash.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'examples/src/bin/flash.rs') diff --git a/examples/src/bin/flash.rs b/examples/src/bin/flash.rs index 84a71ab..e8407cd 100644 --- a/examples/src/bin/flash.rs +++ b/examples/src/bin/flash.rs @@ -10,9 +10,10 @@ use example_common::*; use cortex_m_rt::entry; use defmt::*; use embassy::executor::{task, Executor}; -use embassy::flash::Flash as _; +use embassy::traits::flash::Flash as _; use embassy::util::Forever; +use futures::pin_mut; use nrf_softdevice::{Flash, Softdevice}; static EXECUTOR: Forever = Forever::new(); @@ -25,13 +26,14 @@ async fn softdevice_task(sd: &'static Softdevice) { #[task] async fn flash_task(sd: &'static Softdevice) { let mut f = Flash::take(sd); + pin_mut!(f); info!("starting erase"); - unwrap!(f.erase(0x80000).await); + unwrap!(f.as_mut().erase(0x80000).await); info!("erased!"); info!("starting write"); - unwrap!(f.write(0x80000, &[1, 2, 3, 4]).await); + unwrap!(f.as_mut().write(0x80000, &[1, 2, 3, 4]).await); info!("write done!"); } -- cgit v1.2.3