Author: wmb Date: 2007-05-03 10:25:39 +0200 (Thu, 03 May 2007) New Revision: 347
Modified: dev/olpc/kb3700/ecio.fth Log: OLPC EC commands - Added a time delay to the polling loop for EC command response data, so the system doesn't hang because the EC is being polled too fast for it to make any progress.
Modified: dev/olpc/kb3700/ecio.fth =================================================================== --- dev/olpc/kb3700/ecio.fth 2007-05-03 08:23:33 UTC (rev 346) +++ dev/olpc/kb3700/ecio.fth 2007-05-03 08:25:39 UTC (rev 347) @@ -42,8 +42,8 @@
: ec-release ( -- ) h# ff h# 6c pc! ; : ec-cmd@ ( -- b ) h# 6c pc@ ; -: ec-wait-wr ( -- ) begin ec-cmd@ 2 and 0= key? abort" wait wr" until ; -: ec-wait-rd ( -- ) begin ec-cmd@ 1 and key? abort" wait rd" until ; +: ec-wait-wr ( -- ) begin ec-cmd@ 2 and while key? abort" wait wr" 1 ms repeat ; +: ec-wait-rd ( -- ) begin ec-cmd@ 1 and 0= while key? abort" wait rd" 1 ms repeat ; : ec-cmd! ( b -- ) ec-wait-wr h# 6c pc! ec-wait-wr ; : ec-dat@ ( -- b ) ec-wait-rd h# 68 pc@ ; : ec-dat! ( b -- ) ec-wait-wr h# 68 pc! ;