Skip to content

Commit 0641b71

Browse files
author
Joseph Ross
authored
Allow partition_table_offset to be specified in the config file. (for #699) (#700)
1 parent 95539cc commit 0641b71

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- Allow `partition_table_offset` to be specified in the config file. (for #699)
13+
1214
### Changed
1315

1416
### Fixed

espflash/src/cli/config.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ pub struct Config {
8787
/// Partition table path
8888
#[serde(default)]
8989
pub partition_table: Option<PathBuf>,
90+
/// Partition table offset
91+
#[serde(default)]
92+
pub partition_table_offset: Option<u32>,
9093
/// Preferred USB devices
9194
#[serde(default)]
9295
pub usb_device: Vec<UsbDevice>,

espflash/src/cli/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,10 @@ pub fn make_flash_data(
826826
.or(config.partition_table.as_deref())
827827
.or(default_partition_table);
828828

829+
let partition_table_offset = image_args
830+
.partition_table_offset
831+
.or(config.partition_table_offset);
832+
829833
if let Some(path) = &bootloader {
830834
println!("Bootloader: {}", path.display());
831835
}
@@ -837,7 +841,7 @@ pub fn make_flash_data(
837841
FlashData::new(
838842
bootloader,
839843
partition_table,
840-
image_args.partition_table_offset,
844+
partition_table_offset,
841845
image_args.target_app_partition,
842846
flash_settings,
843847
image_args.min_chip_rev,

0 commit comments

Comments
 (0)