Modify & transmit params via CAN

This commit is contained in:
2023-04-04 22:05:50 +02:00
parent a5f10be4fd
commit 253b10ba15
10 changed files with 199 additions and 24 deletions

11
Core/Inc/util.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef INC_UTIL_H
#define INC_UTIL_H
// This is wacky preprocessor magic that allows us to count the number of
// members of an enum. Unfortunately, it doesn't work with enum classes, so we
// have to use C-style enums.
#define CountedEnum(NAME, TYPE, ...) \
typedef enum { __VA_ARGS__ } NAME; \
static const size_t NAME##_COUNT = sizeof((int[]){__VA_ARGS__}) / sizeof(int);
#endif // INC_UTIL_H