diff --git a/ports/esp32s2/supervisor/internal_flash.c b/ports/esp32s2/supervisor/internal_flash.c index 26774efac8..4b216a095a 100644 --- a/ports/esp32s2/supervisor/internal_flash.c +++ b/ports/esp32s2/supervisor/internal_flash.c @@ -43,6 +43,11 @@ STATIC const esp_partition_t * _partition; +// TODO: Split the caching out of supervisor/shared/external_flash so we can use it. +#define SECTOR_SIZE 4096 +STATIC uint8_t _cache[SECTOR_SIZE]; +STATIC uint32_t _cache_lba = 0xffffffff; + void supervisor_flash_init(void) { _partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_FAT, @@ -61,11 +66,6 @@ void port_internal_flash_flush(void) { } -// TODO: Split the caching out of supervisor/shared/external_flash so we can use it. -#define SECTOR_SIZE 4096 -STATIC uint8_t _cache[SECTOR_SIZE]; -STATIC uint32_t _cache_lba; - mp_uint_t supervisor_flash_read_blocks(uint8_t *dest, uint32_t block, uint32_t num_blocks) { esp_partition_read(_partition, block * FILESYSTEM_BLOCK_SIZE,