Author: quozl Date: Fri Dec 7 23:20:57 2012 New Revision: 3482 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3482
Log: OLPC XO-1.75 XO-4 - accelerometer informal tests fail second time when the formal test is used between them, fixed by closing accelerometer device after informal tests. #12365.
Modified: cpu/arm/olpc/roller.fth
Modified: cpu/arm/olpc/roller.fth ============================================================================== --- cpu/arm/olpc/roller.fth Fri Dec 7 07:12:24 2012 (r3481) +++ cpu/arm/olpc/roller.fth Fri Dec 7 23:20:57 2012 (r3482) @@ -56,7 +56,7 @@ : get-acceleration ( -- x y z ) " acceleration@" accel-ih $call-method xyz>fraction ; -: init-accelerometer ( -- ) +: open-accelerometer ( -- ) accel-ih if exit then " /accelerometer" open-dev to accel-ih accel-ih 0= abort" Can't open accelerometer" @@ -70,6 +70,9 @@ 1 4 a/b>fraction xyz* to acc-0 [then] ; +: close-accelerometer ( -- ) + accel-ih close-dev 0 to accel-ih +;
\ This is a damping factor for the velocity - essentially a frictional force
@@ -246,12 +249,13 @@ 0 0 0 to vel-b ( 0 0 0 to vel-l ) ; : roller ( -- ) - init-accelerometer + open-accelerometer init-ball text-off clear-drawing begin ( update-laptop ) update-ball d# 50 ms key? until text-on + close-accelerometer ;
: filtered-acceleration ( -- acc-x,y,z ) @@ -326,7 +330,7 @@ then ; : clinometer ( -- ) - init-accelerometer + open-accelerometer init-ball cursor-off clear-drawing @@ -336,6 +340,7 @@ ( update-laptop ) update-angle d# 50 ms key? until cursor-on + close-accelerometer ; : level ( -- ) clinometer