Skip to content

Commit

Permalink
enhance: no erase when flashing by default, close #33
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Nov 4, 2023
1 parent 5d569d0 commit 33fa2a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- No erase by default when flashing

## [0.0.7] - 2023-11-04

### Added
Expand Down
10 changes: 5 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ enum Commands {
/// Address in u32
#[arg(short, long, value_parser = parse_number)]
address: Option<u32>,
/// Do not erase flash before flashing
#[arg(long, short = 'E', default_value = "false")]
no_erase: bool,
/// Erase flash before flashing
#[arg(long, short, default_value = "false")]
erase: bool,
/// Do not reset and run after flashing
#[arg(long, short = 'R', default_value = "false")]
no_run: bool,
Expand Down Expand Up @@ -303,7 +303,7 @@ fn main() -> Result<()> {
}
Flash {
address,
no_erase,
erase,
no_run,
path,
} => {
Expand All @@ -319,7 +319,7 @@ fn main() -> Result<()> {
start_address
);

if !no_erase {
if erase {
log::info!("Erase Flash");
probe.erase_flash()?;
}
Expand Down

0 comments on commit 33fa2a3

Please sign in to comment.