Skip to content

Commit 1ef7bec

Browse files
committed
stay compatible with 1.0.x
1 parent 7f8f155 commit 1ef7bec

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

cargo-espflash/src/main.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,12 @@ fn flash(
245245
if matches.is_present("ram") {
246246
flasher.load_elf_to_ram(&elf_data)?;
247247
} else {
248-
flasher.load_elf_to_flash(&elf_data, bootloader, partition_table, image_format)?;
248+
flasher.load_elf_to_flash_with_format(
249+
&elf_data,
250+
bootloader,
251+
partition_table,
252+
image_format,
253+
)?;
249254
}
250255
println!("\nFlashing has completed!");
251256

espflash/src/flasher.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl Flasher {
439439
}
440440

441441
/// Load an elf image to flash and execute it
442-
pub fn load_elf_to_flash(
442+
pub fn load_elf_to_flash_with_format(
443443
&mut self,
444444
elf_data: &[u8],
445445
bootloader: Option<Vec<u8>>,
@@ -471,6 +471,16 @@ impl Flasher {
471471
Ok(())
472472
}
473473

474+
/// Load an elf image to flash and execute it
475+
pub fn load_elf_to_flash(
476+
&mut self,
477+
elf_data: &[u8],
478+
bootloader: Option<Vec<u8>>,
479+
partition_table: Option<PartitionTable>,
480+
) -> Result<(), Error> {
481+
self.load_elf_to_flash_with_format(elf_data, bootloader, partition_table, None)
482+
}
483+
474484
pub fn change_baud(&mut self, speed: BaudRate) -> Result<(), Error> {
475485
self.connection
476486
.with_timeout(CommandType::ChangeBaud.timeout(), |connection| {

espflash/src/main.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ fn main() -> Result<()> {
105105
partition_table_path.unwrap()
106106
)
107107
})?;
108-
flasher.load_elf_to_flash(&input_bytes, bootloader, partition_table, image_format)?;
108+
flasher.load_elf_to_flash_with_format(
109+
&input_bytes,
110+
bootloader,
111+
partition_table,
112+
image_format,
113+
)?;
109114
}
110115

111116
Ok(())

0 commit comments

Comments
 (0)