diff --git a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp index 53babeed9..0e7964460 100644 --- a/radio/src/storage/yaml/yaml_datastructs_funcs.cpp +++ b/radio/src/storage/yaml/yaml_datastructs_funcs.cpp @@ -67,19 +67,27 @@ namespace yaml_conv_220 { // Please note that the sizes used here are those from the v220 format // (see storage/conversions/yaml/datastructs_220.h) // -static_assert(sizeof(ModuleData) == 29,""); -#if defined(PCBHORUS) || defined(PCBNV14) -static_assert(sizeof(FlightModeData) == 44, ""); -static_assert(sizeof(CustomFunctionData) == 9,""); +static inline void check_yaml_funcs() +{ + check_size(); // offsetof(ModuleData, ppm) == 4 +#if defined(PCBHORUS) + // offsetof(ModelData, flightModeData) + // sizeof(FlightModeData::gvars) + check_size(); + check_size(); +#elif defined(PCBNV14) + check_size(); + check_size(); #elif defined(PCBX7) || defined(PCBXLITE) || defined(PCBX9LITE) -static_assert(sizeof(FlightModeData) == 36, ""); -static_assert(sizeof(CustomFunctionData) == 11,""); -static_assert(sizeof(TelemetryScreenData) == 24, ""); + check_size(); + check_size(); + check_size(); #else -static_assert(sizeof(FlightModeData) == 40, ""); -static_assert(sizeof(CustomFunctionData) == 11,""); -static_assert(sizeof(TelemetryScreenData) == 24, ""); + check_size(); + check_size(); + check_size(); #endif +} #define GVAR_SMALL 128