X9D+ conversion unit test + fixes

This commit is contained in:
Raphael Coeffic
2021-11-10 11:07:02 +01:00
parent 17d4ea5c62
commit c749fd8681
5 changed files with 67 additions and 13 deletions
@@ -465,11 +465,11 @@ bool fmd_is_active(void* user, uint8_t* data, uint32_t bitoffs)
// FM0 defaults to all 0
if (idx == 0) {
return !yaml_is_zero(data, bitoffs, sizeof(FlightModeData));
return !yaml_is_zero(data, bitoffs, sizeof(FlightModeData) << 3UL);
}
// assumes gvars array is last
bool is_active = !yaml_is_zero(data, bitoffs, offsetof(FlightModeData, gvars));
bool is_active = !yaml_is_zero(data, bitoffs, offsetof(FlightModeData, gvars) << 3UL);
data += bitoffs >> 3UL;
FlightModeData* fmd = (FlightModeData*)(data);