mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 03:13:33 +08:00
promote to float (for internal representation) before scaling by format multiplier (#175)
This commit is contained in:
committed by
Lorenz Meier
parent
a2d866520a
commit
4f8ffb3420
@@ -39,7 +39,7 @@ FORMAT_TO_STRUCT = {
|
|||||||
'e', {'int32', 0.01};
|
'e', {'int32', 0.01};
|
||||||
'E', {'uint32', 0.01};
|
'E', {'uint32', 0.01};
|
||||||
'L', {'int32', 0.0000001};
|
'L', {'int32', 0.0000001};
|
||||||
'M', {'int8', 1};
|
'M', {'uint8', 1};
|
||||||
'q', {'int64', 1};
|
'q', {'int64', 1};
|
||||||
'Q', {'uint64', 1}};
|
'Q', {'uint64', 1}};
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ else
|
|||||||
elseif strcmp('single',format_type)
|
elseif strcmp('single',format_type)
|
||||||
dataLen = 4;
|
dataLen = 4;
|
||||||
end
|
end
|
||||||
data = typecast(uint8(byte_array(thisPtr:(thisPtr+dataLen-1))),format_type)*mult;
|
data = double(typecast(uint8(byte_array(thisPtr:(thisPtr+dataLen-1))),format_type))*mult;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user