Skip to content
Snippets Groups Projects
Commit 955af32b authored by Gustavo Jose de Sousa's avatar Gustavo Jose de Sousa Committed by Lorenz Meier
Browse files

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.
parent 9984555f
No related branches found
No related tags found
No related merge requests found
......@@ -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 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment