[openfirmware] r1301 - cpu/x86/pc/olpc
svn at openfirmware.info
svn at openfirmware.info
Wed Aug 19 20:34:36 CEST 2009
Author: rsmith
Date: 2009-08-19 20:34:36 +0200 (Wed, 19 Aug 2009)
New Revision: 1301
Modified:
cpu/x86/pc/olpc/rtcwake.fth
Log:
OLPC: Make the ec wakcup tests exit based on a specific keypress (currently 'x')
rather than just on any key. Also print out the value of any keypress we
receive during the test.
Modified: cpu/x86/pc/olpc/rtcwake.fth
===================================================================
--- cpu/x86/pc/olpc/rtcwake.fth 2009-08-19 03:40:15 UTC (rev 1300)
+++ cpu/x86/pc/olpc/rtcwake.fth 2009-08-19 18:34:36 UTC (rev 1301)
@@ -69,20 +69,31 @@
key drop
;
+\ Check if the 'x' was pressed
+: test-exit?
+ key? if
+ ." Key: "
+ key dup h# 78 = if -1 else 0 then
+ swap .x cr
+ else 0
+ then
+;
+
: autowack-test ( ms -- )
autowack-delay
autowack-on
0 begin
s
- dup space .d (cr 1+ key?
+ dup space .d (cr 1+
+ test-exit?
until
- ." Keypress Exit key= "
- key . drop
+ drop
autowack-off
;
\ for testing wakeups from the EC
: wackup-test-ec ( ms -- )
+ ." Press x to exit" cr
d# 3000 autowack-delay \ At small ms delays the host can miss the SCI so this
\ is the back up.
0 begin ( ms count )
@@ -90,10 +101,10 @@
ec-wackup ( count ms )
s
swap dup ( ms count count )
- space .d (cr 1+ key? ( ms count+1 )
- until
- ." Keypress Exit key= "
- key . 2drop
+ space .d (cr 1+
+ test-exit? ( ms count+1 )
+ until ( ms count+1 )
+ 2drop
autowack-off
;
More information about the openfirmware
mailing list