Author: wmb Date: Sat Dec 31 21:01:45 2011 New Revision: 2789 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2789
Log: OLPC XO-3 - exc7200 touchscreen driver - made the X and Y axis inversion controllable by a "TI" mfg-data tag, by default not inverted, to handle the fact that the real XO touchscreen is not inverted, but a few of the development touchscreens are inverted.
Modified: cpu/arm/olpc/exc7200-touchscreen.fth
Modified: cpu/arm/olpc/exc7200-touchscreen.fth ============================================================================== --- cpu/arm/olpc/exc7200-touchscreen.fth Wed Dec 28 11:10:39 2011 (r2788) +++ cpu/arm/olpc/exc7200-touchscreen.fth Sat Dec 31 21:01:45 2011 (r2789) @@ -7,6 +7,8 @@
0 value screen-w 0 value screen-h +0 instance value invert-x? +0 instance value invert-y?
: dimensions ( -- w h ) screen-w screen-h ;
@@ -19,11 +21,11 @@ : invert-y ( y -- y' ) touchscreen-max-y swap - ;
: scale-x ( x -- x' ) - invert-x + invert-x? if invert-x then screen-w touchscreen-max-x */ ; : scale-y ( y -- y' ) - invert-y + invert-y? if invert-y then screen-h touchscreen-max-y */ ;
@@ -252,6 +254,21 @@ \ Read once to prime the interrupt d# 10 " get" $call-parent 4drop 4drop 2drop " dimensions" $call-screen to screen-h to screen-w + + \ The "TI" tag controls the inverson of X and Y axes. + \ If the tag is missing, axes are not inverted. If present + \ and the value contains either of the letters x or y, the + \ corresponding axis is inverted. This is primarily for + \ development, using prototype touchscreens. + " TI" find-tag if ( adr len ) + begin dup while ( adr len ) + over c@ upc [char] x = if true to invert-x? then + over c@ upc [char] y = if true to invert-y? then + 1 /string ( adr' len' ) + repeat ( adr len ) + 2drop ( ) + then ( ) + flush ;
openfirmware@openfirmware.info