mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-08 13:40:35 +08:00
systemlib: properly check for MULT_COUNT value
Checking with preprocessor directives doesn't have any effect because MULT_COUNT is an enum value rather than a macro. Thus, since MULT_COUNT is undefined from the preprocessor perspective, even if the number of items in `enum MULT_PORTS` (except MULT_COUNT) was greater than 33, the error wouldn't be raised.
This commit is contained in:
committed by
Lorenz Meier
parent
9984555faa
commit
955af32b1c
@@ -55,9 +55,9 @@ enum MULT_PORTS {
|
||||
MULT_COUNT
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
/* Check max multi port count */
|
||||
#if (MULT_COUNT > 33)
|
||||
#error "MULT_COUNT HAS TO BE LESS THAN OR EQUAL 33"
|
||||
static_assert(MULT_COUNT <= 33, "MULT_COUNT HAS TO BE LESS THAN OR EQUAL 33");
|
||||
#endif
|
||||
|
||||
/* FMU board info, to be stored in the first 64 bytes of the FMU EEPROM */
|
||||
|
||||
Reference in New Issue
Block a user