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

Merge pull request #17653 from benpicco/cpu/native-fatfs_defaults

boards/native: select MTD defaults for FAT
This commit is contained in:
chrysn 2022-02-15 09:03:21 +01:00 committed by GitHub
commit 1c3a646936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

@ -60,11 +60,19 @@ void _native_LED_RED_TOGGLE(void);
* @{
*/
#ifndef MTD_PAGE_SIZE
#ifdef MODULE_FATFS
#define MTD_PAGE_SIZE (512)
#else
#define MTD_PAGE_SIZE (256)
#endif
#endif
#ifndef MTD_SECTOR_SIZE
#ifdef MODULE_FATFS
#define MTD_SECTOR_SIZE (512)
#else
#define MTD_SECTOR_SIZE (4096)
#endif
#endif
#ifndef MTD_SECTOR_NUM
#define MTD_SECTOR_NUM (2048)
#endif

View File

@ -91,8 +91,6 @@ riot_fatfs_disk.img
```
CFLAGS += -DMTD_NATIVE_FILENAME=\"riot_fatfs_disk.img\"
CFLAGS += -DMTD_PAGE_SIZE=512
CFLAGS += -DMTD_SECTOR_SIZE=512
CFLAGS += -DMTD_SECTOR_NUM=262144
```

View File

@ -15,8 +15,6 @@ FATFS_IMAGE_FILE_SIZE_MIB ?= 128
ifeq ($(BOARD),native)
#overwrite default mtd_native-config to use fat image as flash device
CFLAGS += -DMTD_NATIVE_FILENAME=\"./bin/riot_fatfs_disk.img\"
CFLAGS += -DMTD_PAGE_SIZE=512
CFLAGS += -DMTD_SECTOR_SIZE=512
CFLAGS += -DFATFS_IMAGE_FILE_SIZE_MIB=$(FATFS_IMAGE_FILE_SIZE_MIB)
CFLAGS += -DMTD_SECTOR_NUM=\(\(\(FATFS_IMAGE_FILE_SIZE_MIB\)*1024*1024\)/MTD_SECTOR_SIZE\)
else

View File

@ -11,12 +11,8 @@ ifeq ($(BOARD),native)
#overwrite default mtd_native-config to use fat image as flash device
MTD_NATIVE_FILENAME ?= \"./bin/riot_fatfs_disk.img\"
MTD_PAGE_SIZE ?= 512
MTD_SECTOR_SIZE ?= 512
MTD_SECTOR_NUM ?= \(\(\(FATFS_IMAGE_FILE_SIZE_MIB\)*1024*1024\)/MTD_SECTOR_SIZE\)
CFLAGS += -DMTD_NATIVE_FILENAME=$(MTD_NATIVE_FILENAME)
CFLAGS += -DMTD_PAGE_SIZE=$(MTD_PAGE_SIZE)
CFLAGS += -DMTD_SECTOR_SIZE=$(MTD_SECTOR_SIZE)
CFLAGS += -DFATFS_IMAGE_FILE_SIZE_MIB=$(FATFS_IMAGE_FILE_SIZE_MIB)
CFLAGS += -DMTD_SECTOR_NUM=$(MTD_SECTOR_NUM)
else