2 Commits
Author SHA1 Message Date
gnxlxnxx 210dde8d1a Update dfu-libusb to version 0.2.1
this closes #4
2022-02-25 19:28:45 +01:00
gnxlxnxxandGitHub 0108a54d8f Merge pull request #3 from gnxlxnxx/main
Move the repo to `dfu-rs` and prepare for release
2022-02-06 14:43:48 +01:00
2 changed files with 4 additions and 14 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
[package]
name = "cargo-dfu"
authors = ["Roman Kretschmer <roman@kretschmer.email>"]
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "cargo extension for flashing embedded rust programs via dfu"
license = "MIT"
@@ -18,8 +18,8 @@ goblin = "0.2.3"
colored = "2.0.0"
rusb = "0.9.0"
pretty_env_logger = "0.3.0"
cargo-project = "0.2.4"
cargo-project = "0.2.7"
clap = {version = "3.0.10", features=["derive"]}
maplit = "1.0.2"
log = "0.4.6"
dfu-libusb = "0.2.0"
dfu-libusb = "0.2.1"
+1 -11
View File
@@ -64,17 +64,7 @@ pub fn flash_bin(binary: &[u8], d: &rusb::Device<GlobalContext>) -> Result<(), U
)
.map_err(|e| UtilError::Dfu(e))?;
std::fs::write("target/out.bin", binary).map_err(|e| UtilError::File(e))?;
dfu.download(
&mut std::fs::OpenOptions::new()
.read(true)
.open("target/out.bin")
.map_err(|e| UtilError::File(e))?,
std::fs::metadata("target/out.bin")
.map_err(|e| UtilError::File(e))?
.len() as u32,
)
.unwrap();
dfu.download_from_slice(binary).unwrap();
Ok(())
}