Custom Bus Trait to support PIO
This commit is contained in:
@ -14,23 +14,23 @@ use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
|
||||
fn main() {
|
||||
// Put `memory.x` in our output directory and ensure it's
|
||||
// on the linker search path.
|
||||
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
File::create(out.join("memory.x"))
|
||||
.unwrap()
|
||||
.write_all(include_bytes!("memory.x"))
|
||||
.unwrap();
|
||||
println!("cargo:rustc-link-search={}", out.display());
|
||||
// // Put `memory.x` in our output directory and ensure it's
|
||||
// // on the linker search path.
|
||||
// let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
// File::create(out.join("memory.x"))
|
||||
// .unwrap()
|
||||
// .write_all(include_bytes!("memory.x"))
|
||||
// .unwrap();
|
||||
// println!("cargo:rustc-link-search={}", out.display());
|
||||
|
||||
// By default, Cargo will re-run a build script whenever
|
||||
// any file in the project changes. By specifying `memory.x`
|
||||
// here, we ensure the build script is only re-run when
|
||||
// `memory.x` is changed.
|
||||
println!("cargo:rerun-if-changed=memory.x");
|
||||
// // By default, Cargo will re-run a build script whenever
|
||||
// // any file in the project changes. By specifying `memory.x`
|
||||
// // here, we ensure the build script is only re-run when
|
||||
// // `memory.x` is changed.
|
||||
// println!("cargo:rerun-if-changed=memory.x");
|
||||
|
||||
println!("cargo:rustc-link-arg-bins=--nmagic");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tlink-rp.x");
|
||||
println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||
// println!("cargo:rustc-link-arg-bins=--nmagic");
|
||||
// println!("cargo:rustc-link-arg-bins=-Tlink.x");
|
||||
// println!("cargo:rustc-link-arg-bins=-Tlink-rp.x");
|
||||
// println!("cargo:rustc-link-arg-bins=-Tdefmt.x");
|
||||
}
|
||||
|
@ -161,6 +161,17 @@ impl ErrorType for MySpi {
|
||||
type Error = Infallible;
|
||||
}
|
||||
|
||||
impl cyw43::SpiBusCyw43<u32> for MySpi {
|
||||
async fn cmd_write<'a>(&'a mut self, write: &'a [u32]) -> Result<(), Self::Error> {
|
||||
self.write(write).await
|
||||
}
|
||||
|
||||
async fn cmd_read<'a>(&'a mut self, write: &'a [u32], read: &'a mut [u32]) -> Result<(), Self::Error> {
|
||||
self.write(write).await?;
|
||||
self.read(read).await
|
||||
}
|
||||
}
|
||||
|
||||
impl SpiBusFlush for MySpi {
|
||||
async fn flush(&mut self) -> Result<(), Self::Error> {
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user