forked from espressif/esp-idf
fix(nvs_flash): Allow matching with partition when label provided is NULL
- When esp_parition_find_first() is called with the partition label provided as NULL by the bootloader, allowing matching to the first partition that matches partition_type and partition_subtype as done in the app variant.
This commit is contained in:
@@ -46,9 +46,9 @@ const esp_partition_t* esp_partition_find_first(esp_partition_type_t type, esp_p
|
|||||||
|
|
||||||
// if everything matches, populate the internal_partition
|
// if everything matches, populate the internal_partition
|
||||||
if (partition->type == type
|
if (partition->type == type
|
||||||
&& partition->subtype == subtype
|
&& partition->subtype == subtype
|
||||||
&& strncmp((char*) partition->label, label, sizeof(partition->label) - 1) == 0) {
|
&& (!label || (label && (strncmp((char*) partition->label, label, sizeof(partition->label) - 1) == 0)))
|
||||||
|
) {
|
||||||
ESP_LOGV(TAG, "Matched", partition->type, partition->subtype, partition->label);
|
ESP_LOGV(TAG, "Matched", partition->type, partition->subtype, partition->label);
|
||||||
internal_partition.flash_chip = NULL; //esp_flash_default_chip;
|
internal_partition.flash_chip = NULL; //esp_flash_default_chip;
|
||||||
internal_partition.type = partition->type;
|
internal_partition.type = partition->type;
|
||||||
|
Reference in New Issue
Block a user