remove address

dfu-libusb does that internally so I don't need to specify that here
main
Roman Kretschmer 4 years ago
parent a6e389c29d
commit be0b991e66
Signed by: gnxlxnxx
GPG Key ID: 354103A8B7289847

@ -137,14 +137,12 @@ fn main() {
println!(" {} {:?}", "Flashing".green().bold(), path);
let (binary, address) = elf_to_bin(path).unwrap();
let (binary, _) = elf_to_bin(path).unwrap();
// Start timer.
let instant = Instant::now();
// let bininfo = hf2::bin_info(&d).expect("bin_info failed");
// log::debug!("{:?}", bininfo);
flash_bin(&binary, address, &d.device()).unwrap();
flash_bin(&binary, &d.device()).unwrap();
// Stop timer.
let elapsed = instant.elapsed();

@ -54,11 +54,7 @@ pub fn elf_to_bin(path: PathBuf) -> Result<(Vec<u8>, u32), UtilError> {
Ok((data, start_address as u32))
}
pub fn flash_bin(
binary: &[u8],
address: u32,
d: &rusb::Device<GlobalContext>,
) -> Result<(), UtilError> {
pub fn flash_bin(binary: &[u8], d: &rusb::Device<GlobalContext>) -> Result<(), UtilError> {
let mut dfu = dfu_libusb::DfuLibusb::open(
&rusb::Context::new().unwrap(),
d.device_descriptor().unwrap().vendor_id(),

Loading…
Cancel
Save