mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Config manager fixes
This commit is contained in:
@@ -24,33 +24,36 @@ enum ModuleType : int8_t {
|
||||
ModuleType_SERVO_1 = 1,
|
||||
ModuleType_DC_MOTOR = 2,
|
||||
ModuleType_BATTERY = 3,
|
||||
ModuleType_SERVO_2 = 4,
|
||||
ModuleType_MIN = ModuleType_SPLITTER,
|
||||
ModuleType_MAX = ModuleType_BATTERY
|
||||
ModuleType_MAX = ModuleType_SERVO_2
|
||||
};
|
||||
|
||||
inline const ModuleType (&EnumValuesModuleType())[4] {
|
||||
inline const ModuleType (&EnumValuesModuleType())[5] {
|
||||
static const ModuleType values[] = {
|
||||
ModuleType_SPLITTER,
|
||||
ModuleType_SERVO_1,
|
||||
ModuleType_DC_MOTOR,
|
||||
ModuleType_BATTERY
|
||||
ModuleType_BATTERY,
|
||||
ModuleType_SERVO_2
|
||||
};
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char * const *EnumNamesModuleType() {
|
||||
static const char * const names[5] = {
|
||||
static const char * const names[6] = {
|
||||
"SPLITTER",
|
||||
"SERVO_1",
|
||||
"DC_MOTOR",
|
||||
"BATTERY",
|
||||
"SERVO_2",
|
||||
nullptr
|
||||
};
|
||||
return names;
|
||||
}
|
||||
|
||||
inline const char *EnumNameModuleType(ModuleType e) {
|
||||
if (::flatbuffers::IsOutRange(e, ModuleType_SPLITTER, ModuleType_BATTERY)) return "";
|
||||
if (::flatbuffers::IsOutRange(e, ModuleType_SPLITTER, ModuleType_SERVO_2)) return "";
|
||||
const size_t index = static_cast<size_t>(e);
|
||||
return EnumNamesModuleType()[index];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user