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

Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Florian Echtler 2012-09-17 21:15:40 +02:00 committed by Jiri Kosina
parent 3155a09fd5
commit a2f6e4e009

View File

@ -585,7 +585,8 @@ static void handler_balance_board(struct wiimote_ext *ext, const __u8 *payload)
} else {
tmp = val[i] - ext->calib[i][1];
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;
}