Skip to content

Commit

Permalink
reduce the size of the erase/write of the partition table
Browse files Browse the repository at this point in the history
  • Loading branch information
pkendall64 committed Sep 1, 2022
1 parent cf008c1 commit ec9e888
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ void app_main()
}

// Write the new partition table
esp_err_t ret = spi_flash_erase_range(CONFIG_PARTITION_TABLE_OFFSET, 0x2000);
esp_err_t ret = spi_flash_erase_range(CONFIG_PARTITION_TABLE_OFFSET, 0x1000);
if (ret == ESP_OK)
{
memset(buffer, 0xFF, sizeof(buffer));
memcpy(buffer, partition_data, sizeof(partition_data));
spi_flash_write(CONFIG_PARTITION_TABLE_OFFSET, buffer, 0x2000);
spi_flash_write(CONFIG_PARTITION_TABLE_OFFSET, buffer, 0x1000);
}

// Set the other partition as boot and reboot
Expand Down

0 comments on commit ec9e888

Please sign in to comment.