From edd0f13845d368a25981a59c423e8327c61ce664 Mon Sep 17 00:00:00 2001 From: LukeMike Date: Fri, 14 Nov 2014 15:09:16 +0100 Subject: [PATCH] AP_HAL: mapped the different sizes of storage for all VR boards --- libraries/AP_HAL/AP_HAL_Boards.h | 14 ++++++++++++-- libraries/AP_HAL_VRBRAIN/Storage.h | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libraries/AP_HAL/AP_HAL_Boards.h b/libraries/AP_HAL/AP_HAL_Boards.h index b4a547724e..4ea19fb744 100644 --- a/libraries/AP_HAL/AP_HAL_Boards.h +++ b/libraries/AP_HAL/AP_HAL_Boards.h @@ -231,15 +231,25 @@ #define HAL_BOARD_NAME "VRBRAIN" #define HAL_CPU_CLASS HAL_CPU_CLASS_150 #define HAL_OS_POSIX_IO 1 -#define HAL_STORAGE_SIZE 8192 -#define HAL_STORAGE_SIZE_AVAILABLE HAL_STORAGE_SIZE #define HAL_BOARD_LOG_DIRECTORY "/fs/microsd/APM/LOGS" #define HAL_BOARD_TERRAIN_DIRECTORY "/fs/microsd/APM/TERRAIN" #define HAL_INS_DEFAULT HAL_INS_VRBRAIN #define HAL_BARO_DEFAULT HAL_BARO_VRBRAIN #define HAL_COMPASS_DEFAULT HAL_COMPASS_VRBRAIN #define HAL_SERIAL0_BAUD_DEFAULT 115200 +#if defined(CONFIG_ARCH_BOARD_VRBRAIN_V45) +#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V45 +#define HAL_STORAGE_SIZE 8192 +#elif defined(CONFIG_ARCH_BOARD_VRBRAIN_V51) +#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRBRAIN_V51 +#define HAL_STORAGE_SIZE 16384 +#elif defined(CONFIG_ARCH_BOARD_VRUBRAIN_V51) +#define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_VRUBRAIN_V51 +#define HAL_STORAGE_SIZE 8192 +#else #define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_NONE +#define HAL_STORAGE_SIZE 8192 +#endif #else #error "Unknown CONFIG_HAL_BOARD type" diff --git a/libraries/AP_HAL_VRBRAIN/Storage.h b/libraries/AP_HAL_VRBRAIN/Storage.h index 4df835c543..0d37134135 100644 --- a/libraries/AP_HAL_VRBRAIN/Storage.h +++ b/libraries/AP_HAL_VRBRAIN/Storage.h @@ -7,7 +7,7 @@ #include "AP_HAL_VRBRAIN_Namespace.h" #include -#define VRBRAIN_STORAGE_SIZE 4096 +#define VRBRAIN_STORAGE_SIZE HAL_STORAGE_SIZE #define VRBRAIN_STORAGE_MAX_WRITE 512 #define VRBRAIN_STORAGE_LINE_SHIFT 9 #define VRBRAIN_STORAGE_LINE_SIZE (1<