AP_HAL: allow SITL to emulate 3 different types of flash storage

This commit is contained in:
Andrew Tridgell 2020-04-12 12:16:24 +10:00
parent e1792f89db
commit efe78fe3e1
1 changed files with 29 additions and 2 deletions

View File

@ -5,11 +5,38 @@
#define HAL_MEM_CLASS HAL_MEM_CLASS_1000
#define HAL_OS_POSIX_IO 1
#define HAL_OS_SOCKETS 1
#define AP_FLASHSTORAGE_TYPE 3
#if defined(STORAGE_USE_FLASH) && STORAGE_USE_FLASH==1
#define HAL_STORAGE_SIZE 15360
#else
#if AP_FLASHSTORAGE_TYPE == 1
// emulate F1/F3 flash
#define HAL_STORAGE_SIZE 15360
#define HAL_FLASH_SECTOR_SIZE 16*1024
#define HAL_FLASH_MIN_WRITE_SIZE 1
#define HAL_FLASH_ALLOW_UPDATE 0
#elif AP_FLASHSTORAGE_TYPE == 2
// emulate F4/F7 flash
#define HAL_STORAGE_SIZE 15360
#define HAL_FLASH_SECTOR_SIZE 16*1024
#define HAL_FLASH_MIN_WRITE_SIZE 1
#define HAL_FLASH_ALLOW_UPDATE 1
#elif AP_FLASHSTORAGE_TYPE == 3
// emulate H7 flash
#define HAL_STORAGE_SIZE 16384
#define HAL_FLASH_SECTOR_SIZE 128*1024
#define HAL_FLASH_MIN_WRITE_SIZE 32
#define HAL_FLASH_ALLOW_UPDATE 0
#endif
#endif
#ifndef HAL_STORAGE_SIZE
#define HAL_STORAGE_SIZE 16384
#endif
#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE
#define HAL_BOARD_LOG_DIRECTORY "logs"
#define HAL_BOARD_TERRAIN_DIRECTORY "terrain"