Am Montag, 2. Juli 2007 schrieb Ondrej Zary:
> + * IRTOUCH Part
> + */
> +#ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
> +static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
> +{
> +       dev->x = (pkt[3] << 8) | pkt[2];
> +       dev->y = (pkt[5] << 8) | pkt[4];
> +       dev->touch = (pkt[1] & 0x03) ? 1 : 0;
> +
> +       return 1;
> +}
> +#endif
> +

Your description says the higher order byte comes first.
And could you use le16_to_cpu() rsp. be16_to_cpu() to read the values?
It is easier to read.

        Regards
                Oliver

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to