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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

On 17.09.2012 12:31, David Herrmann wrote:
  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
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux