8000 sflash_diskio.c: Use spi_flash_get_chip_size() to determine the flash size by robert-hh · Pull Request #109 · pycom/pycom-micropython-sigfox · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

sflash_diskio.c: Use spi_flash_get_chip_size() to determine the flash size #109

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion esp32/fatfs/src/drivers/sflash_diskio.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
#include "freertos/semphr.h"
#include "freertos/queue.h"

#include "esp_spi_flash.h"


static uint8_t *sflash_block_cache;
static bool sflash_cache_is_dirty;
Expand All @@ -33,7 +35,7 @@ static bool sflash_write (void) {

DRESULT sflash_disk_init (void) {
if (!sflash_init_done) {
if (esp_get_revision() > 0) {
if (spi_flash_get_chip_size() > (4 * 1024 * 1024)) {
sflash_start_address = SFLASH_START_ADDR_8MB;
sflash_fs_sector_count = SFLASH_FS_SECTOR_COUNT_8MB;
} else {
Expand Down
0