lib/third_party/mcu_vendor/espressif/esp-idf/components/bootloader_support/src/bootloader_utility.c
/* Given a partition index, return the partition position data from the bootloader_state_t structure */
Given a partition index, return the partition position data from the bootloader_state_t structure
Given a partition index return the partition position data from the bootloader_state_t structure
static esp_partition_pos_t index_to_partition(const bootloader_state_t *bs, int index)
{
    if (index == FACTORY_INDEX) {
        return bs->factory;
    }
    if (index == TEST_APP_INDEX) {
        return bs->test;
    }
    if (index >= 0 && index < MAX_OTA_SLOTS && index < bs->app_count) {
        return bs->ota[index];
    }
    esp_partition_pos_t invalid = { 0 };
    return invalid;
}
static esp_partition_pos_t index_to_partition ( const bootloader_state_t * bs , int index ) { if ( index == FACTORY_INDEX ) { return bs -> factory ; } if ( index == TEST_APP_INDEX ) { return bs -> test ; } if ( index >= 0 && index < MAX_OTA_SLOTS && index < bs -> app_count ) { return bs -> ota [ index ] ; } esp_partition_pos_t invalid = { 0 } ; return invalid ; }
Given a partition index, return the partition position data from the bootloader_state_t structure
Given a partition index return the partition position data from the bootloader_state_t structure