aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/rpi-pico-w/build.rs34
-rw-r--r--examples/rpi-pico-w/src/main.rs11
2 files changed, 28 insertions, 17 deletions
diff --git a/examples/rpi-pico-w/build.rs b/examples/rpi-pico-w/build.rs
index 3f915f931..d4c3ec89d 100644
--- a/examples/rpi-pico-w/build.rs
+++ b/examples/rpi-pico-w/build.rs
@@ -14,23 +14,23 @@ use std::io::Write;
14use std::path::PathBuf; 14use std::path::PathBuf;
15 15
16fn main() { 16fn main() {
17 // Put `memory.x` in our output directory and ensure it's 17 // // Put `memory.x` in our output directory and ensure it's
18 // on the linker search path. 18 // // on the linker search path.
19 let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap()); 19 // let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
20 File::create(out.join("memory.x")) 20 // File::create(out.join("memory.x"))
21 .unwrap() 21 // .unwrap()
22 .write_all(include_bytes!("memory.x")) 22 // .write_all(include_bytes!("memory.x"))
23 .unwrap(); 23 // .unwrap();
24 println!("cargo:rustc-link-search={}", out.display()); 24 // println!("cargo:rustc-link-search={}", out.display());
25 25
26 // By default, Cargo will re-run a build script whenever 26 // // By default, Cargo will re-run a build script whenever
27 // any file in the project changes. By specifying `memory.x` 27 // // any file in the project changes. By specifying `memory.x`
28 // here, we ensure the build script is only re-run when 28 // // here, we ensure the build script is only re-run when
29 // `memory.x` is changed. 29 // // `memory.x` is changed.
30 println!("cargo:rerun-if-changed=memory.x"); 30 // println!("cargo:rerun-if-changed=memory.x");
31 31
32 println!("cargo:rustc-link-arg-bins=--nmagic"); 32 // println!("cargo:rustc-link-arg-bins=--nmagic");
33 println!("cargo:rustc-link-arg-bins=-Tlink.x"); 33 // println!("cargo:rustc-link-arg-bins=-Tlink.x");
34 println!("cargo:rustc-link-arg-bins=-Tlink-rp.x"); 34 // println!("cargo:rustc-link-arg-bins=-Tlink-rp.x");
35 println!("cargo:rustc-link-arg-bins=-Tdefmt.x"); 35 // println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
36} 36}
diff --git a/examples/rpi-pico-w/src/main.rs b/examples/rpi-pico-w/src/main.rs
index c706e121d..f768af193 100644
--- a/examples/rpi-pico-w/src/main.rs
+++ b/examples/rpi-pico-w/src/main.rs
@@ -161,6 +161,17 @@ impl ErrorType for MySpi {
161 type Error = Infallible; 161 type Error = Infallible;
162} 162}
163 163
164impl cyw43::SpiBusCyw43<u32> for MySpi {
165 async fn cmd_write<'a>(&'a mut self, write: &'a [u32]) -> Result<(), Self::Error> {
166 self.write(write).await
167 }
168
169 async fn cmd_read<'a>(&'a mut self, write: &'a [u32], read: &'a mut [u32]) -> Result<(), Self::Error> {
170 self.write(write).await?;
171 self.read(read).await
172 }
173}
174
164impl SpiBusFlush for MySpi { 175impl SpiBusFlush for MySpi {
165 async fn flush(&mut self) -> Result<(), Self::Error> { 176 async fn flush(&mut self) -> Result<(), Self::Error> {
166 Ok(()) 177 Ok(())