Thread (8 messages) 8 messages, 3 authors, 2012-09-17

Re: [PATCH 2/2] HID: wiimote: Parse calibration data of balance boards

flat view

From: Florian Echtler <hidden>
Date: 2012-09-17 15:21:06

Darn, I just realized there may be an error here:

On 17.09.2012 12:31, David Herrmann wrote:
quoted hunk ↗ jump to hunk
  drivers/hid/hid-wiimote-ext.c | 39 ++++++++++++++++++++++++++++++++++++++-
  1 file changed, 38 insertions(+), 1 deletion(-)

+	/* apply calibration data */
+	for (i = 0; i < 4; i++) {
+		if (val[i] < ext->calib[i][1]) {
+			tmp = val[i] - ext->calib[i][0];
+			tmp *= 1700;
+			tmp /= ext->calib[i][1] - ext->calib[i][0];
+		} else {
+			tmp = val[i] - ext->calib[i][1];
+			tmp *= 1700;
+			tmp /= ext->calib[i][2] - ext->calib[i][1] + 1700;
I think this is not exactly the same formula as in my original patch; I'm quite sure this should read:

	tmp /= ext->calib[i][2] - ext->calib[i][1];
	tmp += 1700;

instead.

Florian
-- 
SENT FROM MY PDP-11
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help