From 9369262e63d8e3169526e25c8f2b5331837352a0 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 15 Feb 2017 18:41:15 +0100 Subject: [PATCH] navigator: allow more mission items Since using more than 256 mission items has been tested and fixed, the limit can now be raised to more than 256 (but smaller than UINT16_MAX). Since the whole file is allocated in advance on NuttX, the limit there is (arbitrarily) set to 2000. For POSIX archs such as SITL, we don't really need to constrain ourselves any longer. --- src/modules/navigator/navigation.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/navigator/navigation.h b/src/modules/navigator/navigation.h index 439bbc02e3..69c0384b45 100644 --- a/src/modules/navigator/navigation.h +++ b/src/modules/navigator/navigation.h @@ -47,8 +47,10 @@ #if defined(MEMORY_CONSTRAINED_SYSTEM) # define NUM_MISSIONS_SUPPORTED 50 +#elif defined(__PX4_POSIX) +# define NUM_MISSIONS_SUPPORTED (UINT16_MAX-1) // This is allocated as needed. #else -# define NUM_MISSIONS_SUPPORTED 256 +# define NUM_MISSIONS_SUPPORTED 2000 // This allocates a file of around 181 kB on the SD card. #endif #define NAV_EPSILON_POSITION 0.001f /**< Anything smaller than this is considered zero */