Author: quozl Date: Tue Nov 1 06:37:37 2011 New Revision: 2661 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2661
Log: OLPC XO-1.75 - wait for data to be available at the accelerometer before reading it. Side effect of doubling test time to five seconds. Removes some positional jitter in roller caused by the low and high bytes being from different samples.
Modified: cpu/arm/olpc/1.75/accelerometer.fth
Modified: cpu/arm/olpc/1.75/accelerometer.fth ============================================================================== --- cpu/arm/olpc/1.75/accelerometer.fth Tue Nov 1 06:32:03 2011 (r2660) +++ cpu/arm/olpc/1.75/accelerometer.fth Tue Nov 1 06:37:37 2011 (r2661) @@ -15,6 +15,7 @@ : accelerometer-off ( -- ) h# 07 ctl1! ; : wext ( b -- n ) dup h# 8000 and if h# ffff0000 or then ; : acceleration@ ( -- x y z ) + begin h# 27 acc-reg@ h# 08 and until \ wait for data available h# 28 acc-reg@ h# 29 acc-reg@ bwjoin wext 5 >>a h# 2a acc-reg@ h# 2b acc-reg@ bwjoin wext 5 >>a h# 2c acc-reg@ h# 2d acc-reg@ bwjoin wext 5 >>a
openfirmware@openfirmware.info