On Sun, Jul 17, 2011 at 07:10:39PM -0500, Chris Bagwell wrote:
> This is probably source of bug tracker #3008864.
> 
> Comment below.
> 
> On Sun, Jul 17, 2011 at 6:51 PM, Peter Hutterer
> <[email protected]> wrote:
> > Missing shift would report the wrong pressure maximum.
> >
> > Reported-by: Chris Bagwell <[email protected]>
> > Signed-off-by: Peter Hutterer <[email protected]>
> > ---
> >  include/isdv4.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/include/isdv4.h b/include/isdv4.h
> > index 606ef01..f250287 100644
> > --- a/include/isdv4.h
> > +++ b/include/isdv4.h
> > @@ -118,7 +118,7 @@ static int isdv4ParseQuery(const unsigned char *buffer, 
> > const size_t len,
> >        /* FIXME: big endian? */
> >        reply->x_max = (buffer[1] << 9) | (buffer[2] << 2) | ((buffer[6] >> 
> > 5) & 0x3);
> >        reply->y_max = (buffer[3] << 9) | (buffer[4] << 2) | ((buffer[6] >> 
> > 3) & 0x3);
> > -       reply->pressure_max = buffer[5] | (buffer[6] & 0x7);
> > +       reply->pressure_max = buffer[5] | (buffer[6] & 0x7) << 7;
> 
> Nitpicking but buffer[6] comes first in the similar function below this one.

oh, no worries. swapped the two around:

diff --git a/include/isdv4.h b/include/isdv4.h
index f250287..539f609 100644
--- a/include/isdv4.h
+++ b/include/isdv4.h
@@ -118,7 +118,7 @@ static int isdv4ParseQuery(const unsigned char *buffer, 
const size_t len,
        /* FIXME: big endian? */
        reply->x_max = (buffer[1] << 9) | (buffer[2] << 2) | ((buffer[6] >> 5) 
& 0x3);
        reply->y_max = (buffer[3] << 9) | (buffer[4] << 2) | ((buffer[6] >> 3) 
& 0x3);
-       reply->pressure_max = buffer[5] | (buffer[6] & 0x7) << 7;
+       reply->pressure_max = (buffer[6] & 0x7) << 7 | buffer[5];
        reply->tilt_y_max = buffer[7];
        reply->tilt_x_max = buffer[8];
        reply->version = buffer[9] << 7 | buffer[10];

> Either way:
> 
> Reviewed-by: Chris Bagwell <[email protected]>

thanks

Cheers,
  Peter

> 
> >        reply->tilt_y_max = buffer[7];
> >        reply->tilt_x_max = buffer[8];
> >        reply->version = buffer[9] << 7 | buffer[10];
> > --
> > 1.7.6
> >
> >
> 

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to