Commit a2f6e4e0 authored by Florian Echtler's avatar Florian Echtler Committed by Jiri Kosina

HID: wiimote: fix weight conversion error for values > 17kg

Signed-off-by: default avatarFlorian Echtler <floe@butterbrot.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 3155a09f
...@@ -585,7 +585,8 @@ static void handler_balance_board(struct wiimote_ext *ext, const __u8 *payload) ...@@ -585,7 +585,8 @@ static void handler_balance_board(struct wiimote_ext *ext, const __u8 *payload)
} else { } else {
tmp = val[i] - ext->calib[i][1]; tmp = val[i] - ext->calib[i][1];
tmp *= 1700; tmp *= 1700;
tmp /= ext->calib[i][2] - ext->calib[i][1] + 1700; tmp /= ext->calib[i][2] - ext->calib[i][1];
tmp += 1700;
} }
val[i] = tmp; val[i] = tmp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment