mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 13:14:32 +02:00
Allow to find any partition type (app and data) with iterator
Merges https://github.com/espressif/esp-idf/pull/6586
This commit is contained in:
@@ -45,6 +45,8 @@ extern "C" {
|
||||
typedef enum {
|
||||
ESP_PARTITION_TYPE_APP = 0x00, //!< Application partition type
|
||||
ESP_PARTITION_TYPE_DATA = 0x01, //!< Data partition type
|
||||
|
||||
ESP_PARTITION_TYPE_ANY = 0xff, //!< Used to search for partitions with any type
|
||||
} esp_partition_type_t;
|
||||
|
||||
/**
|
||||
|
@@ -108,10 +108,10 @@ esp_partition_iterator_t esp_partition_next(esp_partition_iterator_t it)
|
||||
_lock_acquire(&s_partition_list_lock);
|
||||
for (; it->next_item != NULL; it->next_item = SLIST_NEXT(it->next_item, next)) {
|
||||
esp_partition_t* p = &it->next_item->info;
|
||||
if (it->type != p->type) {
|
||||
if (it->type != ESP_PARTITION_TYPE_ANY && it->type != p->type) {
|
||||
continue;
|
||||
}
|
||||
if (it->subtype != 0xff && it->subtype != p->subtype) {
|
||||
if (it->subtype != ESP_PARTITION_SUBTYPE_ANY && it->subtype != p->subtype) {
|
||||
continue;
|
||||
}
|
||||
if (it->label != NULL && strcmp(it->label, p->label) != 0) {
|
||||
|
Reference in New Issue
Block a user