@@ -53,6 +53,7 @@ pub trait ChipType {
53
53
bootloader : Option < Vec < u8 > > ,
54
54
partition_table : Option < PartitionTable > ,
55
55
image_format : ImageFormatId ,
56
+ chip_revision : Option < u32 > ,
56
57
) -> Result < Box < dyn ImageFormat < ' a > + ' a > , Error > ;
57
58
58
59
/// Read the MAC address of the connected chip.
@@ -158,20 +159,35 @@ impl Chip {
158
159
bootloader : Option < Vec < u8 > > ,
159
160
partition_table : Option < PartitionTable > ,
160
161
image_format : Option < ImageFormatId > ,
162
+ chip_revision : Option < u32 > ,
161
163
) -> Result < Box < dyn ImageFormat < ' a > + ' a > , Error > {
162
164
let image_format = image_format. unwrap_or_else ( || self . default_image_format ( ) ) ;
163
165
164
166
match self {
165
- Chip :: Esp32 => {
166
- Esp32 :: get_flash_segments ( image, bootloader, partition_table, image_format)
167
+ Chip :: Esp32 => Esp32 :: get_flash_segments (
168
+ image,
169
+ bootloader,
170
+ partition_table,
171
+ image_format,
172
+ chip_revision,
173
+ ) ,
174
+ Chip :: Esp32c3 => Esp32c3 :: get_flash_segments (
175
+ image,
176
+ bootloader,
177
+ partition_table,
178
+ image_format,
179
+ chip_revision,
180
+ ) ,
181
+ Chip :: Esp32s2 => Esp32s2 :: get_flash_segments (
182
+ image,
183
+ bootloader,
184
+ partition_table,
185
+ image_format,
186
+ chip_revision,
187
+ ) ,
188
+ Chip :: Esp8266 => {
189
+ Esp8266 :: get_flash_segments ( image, None , None , image_format, chip_revision)
167
190
}
168
- Chip :: Esp32c3 => {
169
- Esp32c3 :: get_flash_segments ( image, bootloader, partition_table, image_format)
170
- }
171
- Chip :: Esp32s2 => {
172
- Esp32s2 :: get_flash_segments ( image, bootloader, partition_table, image_format)
173
- }
174
- Chip :: Esp8266 => Esp8266 :: get_flash_segments ( image, None , None , image_format) ,
175
191
}
176
192
}
177
193
0 commit comments