On Wed, Jan 6, 2010 at 7:55 PM, Ping <[email protected]> wrote:
>
> Both tpc and Bamboo P&T are the same, protocol-wise.  They both have
> separate interfaces for touch and pen.  In tpc routine, all touch data
> are ignored until a new touch is in-prox again if pen was in-prox.  I
> fear you processed touch data before pen is out or at least before a
> new touch is in.
>

I just looked at the tpc code again and I don't see any major
differences between the way the stylusInProx is being handled vs what
I implemented in bpt.  There are a couple differences in touchInProx
handling:
1. the prox in the touch section that will process the null packet
that touch sends out to clear the state after the last finger is
removed.  It makes sure that touchInProx is clear even if the pen
isn't present.  This is linked to the extra if statement in the touch
section.
2. I toggle touchInProx using the pen prox value (maybe it shouldn't do this).

But still there is the issue with accessing stylusInProx
simultaneously (i.e. possibly writing to it in the pen section while
reading in the touch section).
In that case I don't see how tpc wouldn't have the same issue?

>From wacom_bpt_irq: (removed spin_lock calls for clarity)

        if (urb->actual_length == WACOM_PKGLEN_BBTOUCH) {
                ...
                prox = (data[17] & 0x30 >> 4);
                if (!stylusInProx) {
                        if (prox) {
                                if (touchInProx) {
                                          ...
                                        touchOut = 1;
                                          ...
                                }
                        } else {
                               ...
                                touchOut = 0;
                                touchInProx = 1;
                                ...
                        }
                } else if (touchOut || !prox) { /* force touch out-prox */
                        ...
                        touchOut = 0;
                        touchInProx = 1;
                        ...
                }
        } else if (urb->actual_length == WACOM_PKGLEN_BBFUN) {
                   ...
                touchInProx = ~prox;
                stylusInProx = prox;
                   ...
                if (has_data && in_box) {
                       ...
                } else {
                        touchInProx = 1;
                }


>From wacom_tpc_irq:

        if ((urb->actual_length == WACOM_PKGLEN_TPC1FG) /* single touch */
                        || (data[0] == WACOM_REPORT_TPC1FG) /* single touch */
                        || (data[0] == WACOM_REPORT_TPC2FG)) { /* 2FG touch */
                   ...
                if (!stylusInProx) { /* stylus not in prox */
                    ...
                } else if (touchOut || !prox) { /* force touch out-prox */
                        ...
                        touchOut = 0;
                        touchInProx = 1;
                        ...
                }
        } else if (data[0] == WACOM_REPORT_PENABLED) { /* Penabled */
               ...
                stylusInProx = prox;

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to