Added int cast to handle arithmetic correctly

This commit is contained in:
Lorenz Meier 2014-02-21 12:50:29 +01:00
parent 06b69b70a5
commit 983cff56b3
1 changed files with 1 additions and 1 deletions

View File

@ -387,7 +387,7 @@ dsm_decode(hrt_abstime frame_time, uint16_t *values, uint16_t *num_values)
*/
/* scaled integer for decent accuracy while staying efficient */
value = (((value - 1024) * 1000) / 1700) + 1500;
value = ((((int)value - 1024) * 1000) / 1700) + 1500;
/*
* Store the decoded channel into the R/C input buffer, taking into