Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow partition_table_offset to be specified in the config file. (for #699) #700

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Allow `partition_table_offset` to be specified in the config file. (for #699)

### Changed

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions espflash/src/cli/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ pub struct Config {
/// Partition table path
#[serde(default)]
pub partition_table: Option<PathBuf>,
/// Partition table offset
#[serde(default)]
pub partition_table_offset: Option<u32>,
/// Preferred USB devices
#[serde(default)]
pub usb_device: Vec<UsbDevice>,
Expand Down
6 changes: 5 additions & 1 deletion espflash/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,10 @@ pub fn make_flash_data(
.or(config.partition_table.as_deref())
.or(default_partition_table);

let partition_table_offset = image_args
.partition_table_offset
.or(config.partition_table_offset);

if let Some(path) = &bootloader {
println!("Bootloader: {}", path.display());
}
Expand All @@ -837,7 +841,7 @@ pub fn make_flash_data(
FlashData::new(
bootloader,
partition_table,
image_args.partition_table_offset,
partition_table_offset,
image_args.target_app_partition,
flash_settings,
image_args.min_chip_rev,
Expand Down
Loading