Changeset 3546
- Timestamp:
- Feb 14, 2013 2:07:23 AM (3 months ago)
- Files:
-
- 1 added
- 3 edited
-
cpu/arm/olpc/1.75/switches.fth (modified) (1 diff)
-
cpu/arm/olpc/cl4/switches.fth (modified) (1 diff)
-
cpu/x86/pc/olpc/via/switches.fth (modified) (1 diff)
-
dev/olpc/lidtest.fth (added)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/1.75/switches.fth
r3176 r3546 10 10 11 11 0 0 reg \ So test-all will run the test 12 : open ( -- okay? ) true ;13 : close ( -- ) ;14 : lid? ( -- flag ) d# 129 gpio-pin@ 0= ;15 : ebook? ( -- flag ) d# 128 gpio-pin@ 0= ;16 12 17 : ?key-abort ( -- ) key? if key esc = abort" Aborted" then ; 18 : wait-not-lid ( -- ) 19 ." Deactivate lid switch" cr 20 begin ?key-abort lid? 0= until 21 ; 22 : wait-lid ( -- ) 23 ." Activate lid switch" cr 24 begin ?key-abort lid? until 25 ; 26 : wait-not-ebook ( -- ) 27 ." Deactivate ebook switch" cr 28 begin ?key-abort ebook? 0= until 29 ; 30 : wait-ebook ( -- ) 31 ." Activate ebook switch" cr 32 begin ?key-abort ebook? until 33 ; 13 : lid? ( -- flag ) lid-switch-gpio# gpio-pin@ 0= ; 14 : ebook? ( -- flag ) ebook-mode-gpio# gpio-pin@ 0= ; 34 15 35 : all-switch-states ( -- ) 36 lid? if wait-not-lid else wait-lid then 37 ebook? if wait-not-ebook else wait-ebook then 38 ; 39 40 : selftest ( -- error? ) 41 ['] all-switch-states catch 42 ; 43 16 fload ${BP}/dev/olpc/lidtest.fth 44 17 fload ${BP}/dev/olpc/lid.fth 45 18 end-package -
cpu/arm/olpc/cl4/switches.fth
r3176 r3546 11 11 12 12 0 0 reg \ So test-all will run the test 13 : open ( -- okay? ) true ;14 : close ( -- ) ;15 : lid? ( -- flag ) d# 129 gpio-pin@ 0= ;16 : ebook? ( -- flag ) d# 130 gpio-pin@ 0= ;17 13 18 : ?key-abort ( -- ) key? if key esc = abort" Aborted" then ; 19 : wait-not-lid ( -- ) 20 ." Deactivate lid switch" cr 21 begin ?key-abort lid? 0= until 22 ; 23 : wait-lid ( -- ) 24 ." Activate lid switch" cr 25 begin ?key-abort lid? until 26 ; 27 : wait-not-ebook ( -- ) 28 ." Deactivate ebook switch" cr 29 begin ?key-abort ebook? 0= until 30 ; 31 : wait-ebook ( -- ) 32 ." Activate ebook switch" cr 33 begin ?key-abort ebook? until 34 ; 14 : lid? ( -- flag ) lid-switch-gpio# gpio-pin@ 0= ; 15 : ebook? ( -- flag ) ebook-mode-gpio# gpio-pin@ 0= ; 35 16 36 : all-switch-states ( -- ) 37 lid? if wait-not-lid else wait-lid then 38 ebook? if wait-not-ebook else wait-ebook then 39 ; 40 41 : selftest ( -- error? ) 42 ['] all-switch-states catch 43 ; 44 17 fload ${BP}/dev/olpc/lidtest.fth 45 18 fload ${BP}/dev/olpc/lid.fth 46 19 end-package -
cpu/x86/pc/olpc/via/switches.fth
r1800 r3546 4 4 0 0 " 0" " /" begin-package 5 5 " switches" device-name 6 6 7 0 0 reg \ So test-all will run the test 7 : open ( -- okay? ) true ; 8 : close ( -- ) ; 8 9 9 : lid? ( -- flag ) h# 48 acpi-l@ h# 80 and 0= ; 10 10 : ebook? ( -- flag ) h# 48 acpi-l@ h# 200 and 0= ; 11 11 12 : ?key-abort ( -- ) key? if key esc = abort" Aborted" then ; 13 : wait-not-lid ( -- ) 14 ." Deactivate lid switch" cr 15 begin ?key-abort lid? 0= until 16 ; 17 : wait-lid ( -- ) 18 ." Activate lid switch" cr 19 begin ?key-abort lid? until 20 ; 21 : wait-not-ebook ( -- ) 22 ." Deactivate ebook switch" cr 23 begin ?key-abort ebook? 0= until 24 ; 25 : wait-ebook ( -- ) 26 ." Activate ebook switch" cr 27 begin ?key-abort ebook? until 28 ; 29 30 : all-switch-states ( -- ) 31 lid? if wait-not-lid else wait-lid then 32 ebook? if wait-not-ebook else wait-ebook then 33 ; 34 35 : selftest ( -- error? ) 36 ['] all-switch-states catch 37 ; 38 12 fload ${BP}/dev/olpc/lidtest.fth 39 13 end-package 40 14
Note: See TracChangeset
for help on using the changeset viewer.
