Skip to content

Commit 628947d

Browse files
authored
Impl missing reset after commands (#867)
1 parent 47b661d commit 628947d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- `--mmu-page-size` parameter for `flash` and `save-image` (#835)
2727
- Run some arguments checks for monitoring flags. (#842)
2828
- Add support for the ESP32-C5 (#863)
29+
- `--after` options now work with `espflash board-info`, `espflash read-flash` and `espflash checksum-md5` (#867)
2930

3031
### Changed
3132

espflash/src/cli/mod.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,16 @@ pub fn board_info(args: &ConnectArgs, config: &Config) -> Result<()> {
440440
let mut flasher = connect(args, config, true, true)?;
441441
print_board_info(&mut flasher)?;
442442

443-
if flasher.chip() != Chip::Esp32 {
443+
let chip = flasher.chip();
444+
if chip != Chip::Esp32 {
444445
let security_info = flasher.security_info()?;
445446
println!("{security_info}");
446447
} else {
447448
println!("Security features: None");
448449
}
449450

451+
flasher.connection().reset_after(!args.no_stub, chip)?;
452+
450453
Ok(())
451454
}
452455

@@ -457,6 +460,11 @@ pub fn checksum_md5(args: &ChecksumMd5Args, config: &Config) -> Result<()> {
457460
let checksum = flasher.checksum_md5(args.address, args.size)?;
458461
println!("0x{:x}", checksum);
459462

463+
let chip = flasher.chip();
464+
flasher
465+
.connection()
466+
.reset_after(!args.connect_args.no_stub, chip)?;
467+
460468
Ok(())
461469
}
462470

@@ -901,6 +909,11 @@ pub fn read_flash(args: ReadFlashArgs, config: &Config) -> Result<()> {
901909
)?;
902910
}
903911

912+
let chip = flasher.chip();
913+
flasher
914+
.connection()
915+
.reset_after(!args.connect_args.no_stub, chip)?;
916+
904917
Ok(())
905918
}
906919

0 commit comments

Comments
 (0)