mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-22 15:55:40 +03:00
Add STATIC_ASSERT check for box mode count
This commit is contained in:
parent
c03c7d6bce
commit
3dee85cb46
3 changed files with 5 additions and 3 deletions
|
@ -102,9 +102,6 @@ PG_RESET_TEMPLATE(blackboxConfig_t, blackboxConfig,
|
|||
#define BLACKBOX_SHUTDOWN_TIMEOUT_MILLIS 200
|
||||
static const int32_t blackboxSInterval = 4096;
|
||||
|
||||
#define STATIC_ASSERT(condition, name ) \
|
||||
typedef char assert_failed_ ## name [(condition) ? 1 : -1 ]
|
||||
|
||||
// Some macros to make writing FLIGHT_LOG_FIELD_* constants shorter:
|
||||
|
||||
#define PREDICT(x) CONCAT(FLIGHT_LOG_FIELD_PREDICTOR_, x)
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
|
||||
#define BIT(x) (1 << (x))
|
||||
|
||||
#define STATIC_ASSERT(condition, name) \
|
||||
typedef char assert_failed_ ## name [(condition) ? 1 : -1 ] __attribute__((unused))
|
||||
|
||||
/*
|
||||
http://resnet.uoregon.edu/~gurney_j/jmpc/bitwise.html
|
||||
*/
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
#include "common/bitarray.h"
|
||||
#include "common/maths.h"
|
||||
#include "common/utils.h"
|
||||
|
||||
#include "config/feature.h"
|
||||
#include "config/parameter_group.h"
|
||||
|
@ -40,6 +41,7 @@ static bool isUsingNAVModes = false;
|
|||
#endif
|
||||
|
||||
boxBitmask_t rcModeActivationMask; // one bit per mode defined in boxId_e
|
||||
STATIC_ASSERT(CHECKBOX_ITEM_COUNT <= 32, too_many_box_modes);
|
||||
|
||||
PG_REGISTER_ARRAY(modeActivationCondition_t, MAX_MODE_ACTIVATION_CONDITION_COUNT, modeActivationConditions, PG_MODE_ACTIVATION_PROFILE, 0);
|
||||
PG_REGISTER(modeActivationOperatorConfig_t, modeActivationOperatorConfig, PG_MODE_ACTIVATION_OPERATOR_CONFIG, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue