StorageManager: allow for CANDNA storage on F405 boards

this allows for boards using the log structure storage with 15360
bytes of storage have a CANDNA area.

This fixes CAN support on F405 boards
This commit is contained in:
Andrew Tridgell 2021-01-04 15:45:47 +11:00
parent 8f8283e0f0
commit 69d3264e55
2 changed files with 12 additions and 2 deletions

View File

@ -65,8 +65,12 @@ const StorageManager::StorageArea StorageManager::layout[STORAGE_NUM_AREAS] = {
#if STORAGE_NUM_AREAS == 11
// optimised for lots of parameters for 15k boards with OSD
{ StorageParam, 8192, 7168},
#elif STORAGE_NUM_AREAS == 12
// optimised for lots of parameters for 15k boards with OSD, plus room for CAN DNA
{ StorageParam, 8192, 6144},
{ StorageCANDNA, 14336, 1024},
#endif
#if STORAGE_NUM_AREAS >= 12
#if STORAGE_NUM_AREAS >= 13
{ StorageParam, 8192, 1280},
{ StorageRally, 9472, 300},
{ StorageFence, 9772, 256},
@ -98,8 +102,12 @@ const StorageManager::StorageArea StorageManager::layout[STORAGE_NUM_AREAS] = {
#if STORAGE_NUM_AREAS == 11
// optimised for lots of parameters for 15k boards with OSD
{ StorageParam, 8192, 7168},
#elif STORAGE_NUM_AREAS == 12
// optimised for lots of parameters for 15k boards with OSD, plus room for CAN DNA
{ StorageParam, 8192, 6144},
{ StorageCANDNA, 14336, 1024},
#endif
#if STORAGE_NUM_AREAS >= 12
#if STORAGE_NUM_AREAS >= 13
{ StorageParam, 8192, 1280},
{ StorageRally, 9472, 300},
{ StorageFence, 9772, 256},

View File

@ -28,6 +28,8 @@
*/
#if HAL_STORAGE_SIZE >= 16384
#define STORAGE_NUM_AREAS 15
#elif HAL_STORAGE_SIZE >= 15360 && defined(HAL_NUM_CAN_IFACES)
#define STORAGE_NUM_AREAS 12
#elif HAL_STORAGE_SIZE >= 15360
#define STORAGE_NUM_AREAS 11
#elif HAL_STORAGE_SIZE >= 8192