Changeset 3473
- Timestamp:
- Dec 6, 2012 7:55:54 AM (6 months ago)
- Location:
- cpu/arm/olpc
- Files:
-
- 2 edited
-
cl4/testitems.fth (modified) (1 diff)
-
nn-touchscreen.fth (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/cl4/testitems.fth
r3378 r3473 35 35 : wlan-item ( -- ) " /wlan" mfg-test-dev ; 36 36 : timer-item ( -- ) " /timer" mfg-test-dev ; 37 : touch-item ( -- ) " /touchscreen" mfg-test-dev 38 " mouse" mfg-test-dev ; 37 : touch-item ( -- ) 38 ?close-touchscreen 39 ?close-mouse 40 " /touchscreen" mfg-test-dev 41 " mouse" mfg-test-dev 42 ?open-mouse 43 ?open-touchscreen 44 ; 39 45 : keyboard-item ( -- ) " keyboard" mfg-test-dev ; 40 46 : switch-item ( -- ) " /accelerometer" mfg-test-dev -
cpu/arm/olpc/nn-touchscreen.fth
r3440 r3473 158 158 ; 159 159 160 variable refcount 0 refcount ! 161 160 162 : open ( -- okay? ) 161 pbuf-alloc162 163 my-unit " set-address" $call-parent 163 set-gpios164 no-data? if165 reset164 refcount @ 0= if 165 pbuf-alloc 166 set-gpios 166 167 no-data? if 167 ." no response to reset" cr 168 reset 169 no-data? if 170 ." no response to reset" cr 171 pbuf-free false exit 172 then 173 ['] read-boot-complete catch ?dup if 174 .error 175 ." failed to boot" cr 176 pbuf-free false exit 177 then 178 else 179 flush-input 180 then 181 ['] configure catch ?dup if 182 .error 183 ." failed to configure" cr 168 184 pbuf-free false exit 169 185 then 170 ['] read-boot-complete catch ?dup if 171 .error 172 ." failed to boot" cr 173 pbuf-free false exit 174 then 175 else 176 flush-input 177 then 178 ['] configure catch ?dup if 179 .error 180 ." failed to configure" cr 181 pbuf-free false exit 182 then 186 then 187 refcount @ 1+ refcount ! 183 188 true 184 189 ; 185 190 186 191 : close 187 deconfigure 188 pbuf-free 192 refcount @ 1- 0 max refcount ! 193 refcount @ 0= if 194 deconfigure 195 pbuf-free 196 then 189 197 ; 190 198 … … 195 203 196 204 : stream-poll? ( -- false | x y buttons true ) 205 0 pbuf 2+ c! 197 206 in? if 198 207 \ FIXME: only handles one subpacket … … 1042 1051 .error 1043 1052 ." No touchscreen present" cr false exit 1044 then 1053 then ( okay? ) 1054 0= if false exit then 1045 1055 1046 1056 diagnostic-mode? if
Note: See TracChangeset
for help on using the changeset viewer.
