Changeset 3548
- Timestamp:
- Feb 14, 2013 3:26:44 AM (3 months ago)
- File:
-
- 1 edited
-
dev/olpc/lidtest.fth (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dev/olpc/lidtest.fth
r3546 r3548 4 4 : open ( -- okay? ) true ; 5 5 : close ( -- ) ; 6 6 7 : ?key-abort ( -- ) key? if key esc = abort" Aborted" then ; 7 : wait-not-lid ( -- ) 8 ." Deactivate lid switch" cr 9 begin ?key-abort lid? 0= until 10 ; 11 : wait-lid ( -- ) 12 ." Activate lid switch" cr 13 begin ?key-abort lid? until 14 ; 15 : wait-not-ebook ( -- ) 16 ." Deactivate ebook switch" cr 17 begin ?key-abort ebook? 0= until 18 ; 19 : wait-ebook ( -- ) 20 ." Activate ebook switch" cr 21 begin ?key-abort ebook? until 8 9 : wait-not-lid ( -- ) begin ?key-abort lid? 0= until ; 10 : wait-lid ( -- ) begin ?key-abort lid? until ; 11 : wait-not-ebook ( -- ) begin ?key-abort ebook? 0= until ; 12 : wait-ebook ( -- ) begin ?key-abort ebook? until ; 13 14 : all-switch-states ( -- ) 15 lid? if 16 ." Deactivate lid switch" cr 17 wait-not-lid 18 else 19 ." Activate lid switch" cr 20 wait-lid 21 then 22 ebook? if 23 ." Deactivate ebook switch" cr 24 wait-not-ebook 25 else 26 ." Activate ebook switch" cr 27 wait-ebook 28 then 22 29 ; 23 30 24 : all-switch-states ( -- ) 25 lid? if wait-not-lid else wait-lid then 26 ebook? if wait-not-ebook else wait-ebook then 31 : ty ." Thank you." cr cr ; 32 : pltd ." Please lift the display and rotate it to face you." cr ; 33 34 : field-switch-states ( -- ) 35 cr 36 ebook? if pltd wait-not-ebook ty then 37 38 lid? if ." Please open the lid." cr wait-not-lid ty then 39 40 ." Please close the lid and then open it." cr 41 wait-lid d# 1000 ms wait-not-lid ty 42 43 ." Please rotate the lid to face away, and close it face up." cr 44 wait-ebook d# 1000 ms ty 45 pltd wait-not-ebook ty 27 46 ; 28 47 29 48 : selftest ( -- error? ) 30 ['] all-switch-states catch 49 factory-test? if 50 ['] all-switch-states catch 51 else 52 ['] field-switch-states catch 53 then 31 54 ; 32 55
Note: See TracChangeset
for help on using the changeset viewer.
