Changeset 2160


Ignore:
Timestamp:
Feb 3, 2011, 12:30:28 AM (3 years ago)
Author:
wmb
Message:

Synaptics touchpad driver - removed more dead code and fixed bogus comments left over from the ALPS driver.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dev/olpc/touchpad/syntpad.fth

    r2052 r2160  
    22\ Add this code to the existing mouse driver 
    33dev /mouse 
    4  
    5 variable 'get-data  'get-data  off 
    6 variable 'get-data? 'get-data? off 
    7  
    8 : setup  ( -- ) 
    9    'get-data @  0=  if 
    10       " get-data" my-parent ihandle>phandle find-method  if 
    11          'get-data ! 
    12       then 
    13    then 
    14    'get-data? @  0=  if 
    15       " get-data?" my-parent ihandle>phandle find-method  if 
    16          'get-data? ! 
    17       then 
    18    then 
    19 ; 
    20  
    214 
    225h# f800 constant red 
     
    4225 
    4326\ open            initializes the port and resets the device 
    44 \ cmd             sends a command byte and waits for the ack 
    45 \ read1           reads 1 response byte 
    46 \ read2           reads 2 response bytes 
    47 \ mouse1:1        command e6 
    4827\ mouse2:1        command e7 
    4928\ stream-on       command f4 
    50 \ stream-off      command f5 
     29\ stream-mode     command ea,f4 
    5130\ mouse-status    command e9 and reads 3 response bytes 
    52 \ set-resolution  command e8 then sends another command byte 
    53 \ get-data?       reads a data byte if one is available 
    54 \ get-data        waits for and reads a data byte 
    55  
     31\ stream-poll?    ( -- false | dx dy buttons true ) 
    5632 
    5733variable ptr 
    58 0 value show-raw? 
    59  
    60 \ Runs the special Device ID command and checks for the ALPS return code 
    61 \ Ref: 5.2.10 (1) of Hybrid-GP2B-T-1.pdf 
    6234 
    6335\ The Synaptics touchpad version is 64.02.30 
     
    6840; 
    6941 
    70 \ Put the device into advanced mode and enable it 
     42\ Put the device into streaming mode and enable it 
    7143: start  ( -- ) 
    72    setup 
    7344   stream-mode 
    7445; 
     
    7647\ The normal mouse driver uses remote mode, but this device 
    7748\ doesn't support remote mode, so patch the mouse driver 
    78 \ "open" routine to substitute "noop" for "remote-mode". 
     49\ "open" routine to substitute "start" for "remote-mode". 
    7950 
    8051patch start remote-mode open 
    8152 
    82 \ The following code receives and decodes touchpad packets in the 
    83 \ various special formats 
     53\ The following code receives and decodes touchpad packets 
    8454 
    8555: show-packets  ( adr len -- ) 
     
    11383; 
    11484 
    115 \ Try to receive a GS-format packet.  If one arrives within 
     85\ Try to receive a mouse report packet.  If one arrives within 
    11686\ 20 milliseconds, return true and the decoded information. 
    11787\ Otherwise return false. 
     
    12494; 
    12595 
    126 \ Switch the device to glide format and display 
    127 \ the data that it sends.  Stop when a key is typed. 
     96\ Display raw data from the device, stopping when a key is typed. 
    12897: show-pad  ( -- ) 
    12998   start 
Note: See TracChangeset for help on using the changeset viewer.