Changeset 3404
- Timestamp:
- Nov 1, 2012 12:32:08 AM (8 months ago)
- Location:
- cpu/arm/olpc
- Files:
-
- 2 edited
-
nn-touchscreen.fth (modified) (9 diffs)
-
nnflash.fth (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/nn-touchscreen.fth
r3401 r3404 18 18 create nn-os \ open short test 19 19 create nn-fll \ forced LED levels test 20 create nn-version \ version display21 20 create nn-watch \ graphical signal tests 22 21 … … 29 28 d# 15 value xleds 30 29 d# 11 value yleds 30 31 0. 2value version# 32 : get-version ( -- version.d ) version# ; 33 34 : (.)' ( version-segment.w -- ) (.) type [char] . emit ; 35 36 : .version ( version.d -- ) lwsplit (.)' (.)' lwsplit (.)' (.)' ; 37 38 : show-version ( -- ) 39 ." Neonode zForce Touch Driver firmware version " version# .version cr 40 ; 31 41 32 42 \ XXX these are really platform-related, not touchscreen-related … … 44 54 [then] 45 55 46 : x>x' ( x -- x' ) screen-w swap - ; \ reverse x coordinate 56 defer x>x' ' noop to x>x' 57 : (x>x') ( x -- x' ) screen-w swap - ; \ reverse x coordinate 58 : set-reverse-x ['] (x>x') to x>x' ; 47 59 48 60 : set-gpios … … 56 68 57 69 \ Neonode requested 250 ms 58 \ we observe for 0.0.0.5 59 \ less than 38 ms yields no response to reset, 60 \ 40 ms yields 100 ms overall version check, and 61 \ 45 ms yields 84 ms overall version check. 62 : reset ( -- ) touch-rst-gpio# dup gpio-clr gpio-set d# 50 ms ; 70 : reset ( -- ) touch-rst-gpio# dup gpio-clr gpio-set d# 250 ms ; 63 71 : hold-reset ( -- ) touch-rst-gpio# gpio-clr ; 64 72 : no-data? ( -- no-data? ) touch-int-gpio# gpio-pin@ ; … … 105 113 : read-boot-complete ( -- ) h# 07 d# 0 anticipate ; 106 114 115 : read-version 116 h# 1e h# 01 h# ee 3 bytes-out h# 1e d# 100 anticipate 117 pbuf 2+ c@ h# 1e <> abort" bad response" 118 pbuf 9 + le-w@ pbuf 7 + le-w@ wljoin pbuf 5 + le-w@ pbuf 3 + le-w@ wljoin 119 to version# 120 ; 121 107 122 : initialise ( -- ) h# 01 h# 01 h# ee 3 bytes-out h# 01 d# 20 anticipate ; 108 123 … … 126 141 : configure ( -- ) 127 142 configure? if 143 read-version 144 version# h# 6. d< if set-reverse-x then 128 145 initialise 129 146 set-resolution … … 200 217 loop 201 218 ; 202 203 204 205 [ifdef] nn-version \ version display206 : (.version) ( addr -- )207 dup c@ over 1+ c@ bwjoin ( addr version )208 (.) type209 ;210 211 : .version ( -- )212 pbuf 3 + 3 0 do ( addr )213 (.version) 2+214 [char] . emit215 loop ( addr )216 (.version) drop ( )217 ;218 219 : (version) ( -- )220 h# 1e h# 01 h# ee 3 bytes-out221 h# 1e d# 30 anticipate222 pbuf 2+ c@ h# 1e <> abort" bad response"223 ;224 225 : test-version ( -- )226 (version)227 ." Neonode zForce Touch Driver firmware version "228 .version229 cr230 ;231 232 : get-version ( -- version.d )233 (version)234 pbuf 9 + le-w@ pbuf 7 + le-w@ wljoin pbuf 5 + le-w@ pbuf 3 + le-w@ wljoin235 ;236 237 [then]238 219 239 220 … … 1004 985 : mb-smt ( -- error? ) 1005 986 open 0= if true exit then 1006 test-version987 show-version 1007 988 close 1008 989 false … … 1035 1016 diagnostic-mode? if 1036 1017 0 to faults 1037 [ifdef] nn-version test-version [then]1018 show-version 1038 1019 [ifdef] nn-os test-os [then] 1039 1020 [ifdef] nn-fss test-fss [then] -
cpu/arm/olpc/nnflash.fth
r3402 r3404 18 18 : nn-up-to-date? ( file$ -- flag ) 19 19 2drop h# 0000.0000.0000.0006. \ FIXME: get version from file 20 get-touchscreen-version 20 get-touchscreen-version \ 20ms first time, 270ms subsequent 21 21 d<= 22 22 ;
Note: See TracChangeset
for help on using the changeset viewer.
