1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/esp_common: use XFA with MTD pointers for Flash MTD

This commit is contained in:
Gunar Schorcht 2023-04-11 18:42:01 +02:00
parent 46040a4361
commit d535277ebb

View File

@ -57,12 +57,12 @@
#define ESP_PART_ENTRY_SIZE 0x20
#define ESP_PART_ENTRY_MAGIC ESP_PARTITION_MAGIC
/* the external pointer to the system MTD device */
mtd_dev_t* mtd0 = 0;
static mtd_dev_t _flash_dev;
static mtd_desc_t _flash_driver;
/* the external pointer to the system MTD device */
MTD_XFA_ADD(_flash_dev, 0);
#ifdef MODULE_VFS_DEFAULT
#include "vfs_default.h"
VFS_AUTO_MOUNT(littlefs2, { .dev = &_flash_dev }, VFS_DEFAULT_NVM(0), 0);
@ -205,8 +205,6 @@ void spi_flash_drive_init(void)
_flash_dev.driver = &_flash_driver;
_flash_dev.sector_count = _flash_size / _flashchip->sector_size;
mtd0 = &_flash_dev;
_flash_dev.pages_per_sector = _flashchip->sector_size / _flashchip->page_size;
_flash_dev.page_size = _flashchip->page_size;
/* Emulation for smaller / unaligned writes is present, but at reduced