Make sure the substration is made using two doubles. Since value is unsigned negative results might overflow otherwise. This closes #177
This commit is contained in:
parent
f1e58433c1
commit
1ef4610f52
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ std::string ProtocolMandolyn::decodeData(ControllerMessage &dataMsg)
|
|||
bool parity = value & 0x1;
|
||||
value >>= 1;
|
||||
|
||||
double temp = (value & 0x7FFF) - 6400;
|
||||
double temp = (double)(value & 0x7FFF) - (double)6400;
|
||||
temp = temp/128.0;
|
||||
value >>= 15;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue