mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 04:23:33 +08:00
Fixed the union code generation: if the union contained a power of two number of items, the tag bit length was one higher than needed, causing incorrect serialization.
This commit is contained in:
@@ -70,7 +70,7 @@ struct UAVCAN_EXPORT ${t.cpp_type_name}
|
||||
};
|
||||
};
|
||||
|
||||
typedef ::uavcan::IntegerSpec< ::uavcan::IntegerBitLen< ${len(fields)} >::Result,
|
||||
typedef ::uavcan::IntegerSpec< ::uavcan::IntegerBitLen< ${len(fields)}U - 1U >::Result,
|
||||
::uavcan::SignednessUnsigned, ::uavcan::CastModeTruncate > TagType;
|
||||
|
||||
<!--(macro expand_enum_per_field)--> #! enum_name, enum_comparator
|
||||
|
||||
Reference in New Issue
Block a user