Skip to content

Commit

Permalink
StorageManager: allow for CANDNA storage on F405 boards
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tridge committed Jan 4, 2021
1 parent 8f8283e commit 69d3264
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions libraries/StorageManager/StorageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions libraries/StorageManager/StorageManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 69d3264

Please sign in to comment.