Changeset 2686
- Timestamp:
- Nov 15, 2011 2:14:02 AM (18 months ago)
- Location:
- cpu
- Files:
-
- 3 added
- 2 deleted
- 4 edited
-
arm/olpc/1.75/fw.bth (modified) (2 diffs)
-
arm/olpc/1.75/mfgtest.fth (deleted)
-
arm/olpc/1.75/testitems.fth (added)
-
x86/pc/alex/fw.bth (modified) (1 diff)
-
x86/pc/alex/mfgtest.fth (deleted)
-
x86/pc/alex/testitems.fth (added)
-
x86/pc/olpc/via/fw.bth (modified) (1 diff)
-
x86/pc/olpc/via/mfgtest.fth (modified) (11 diffs)
-
x86/pc/olpc/via/testitems.fth (added)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/olpc/1.75/fw.bth
r2683 r2686 140 140 \ so exiting from emacs doesn't invoke the diag menu. 141 141 ' quit to user-interface 142 fload ${BP}/cpu/arm/olpc/1.75/mfgtest.fth 142 fload ${BP}/cpu/x86/pc/olpc/via/mfgtest.fth 143 fload ${BP}/cpu/arm/olpc/1.75/testitems.fth 143 144 144 145 [ifdef] notyet … … 482 483 rocker-left game-key? if 483 484 protect-fw 484 text-on " test-all" ['] evalguarded485 text-on ['] gamekey-auto-menu guarded 485 486 ." Tests complete - powering off" cr d# 5000 ms power-off 486 487 then -
cpu/x86/pc/alex/fw.bth
r2653 r2686 214 214 patch merge-rect-565 merge-rect merge-cursor \ Hack since we do all our user-level graphics in 565 215 215 patch merge-rect-565 merge-rect merge-cursor \ Hack since we do all our user-level graphics in 565 216 fload ${BP}/cpu/x86/pc/ alex/mfgtest.fth216 fload ${BP}/cpu/x86/pc/olpc/via/mfgtest.fth 217 217 fload ${BP}/dev/olpc/confirm.fth 218 218 : bright! ( level -- ) drop ; -
cpu/x86/pc/olpc/via/fw.bth
r2683 r2686 327 327 ' quit to user-interface 328 328 fload ${BP}/cpu/x86/pc/olpc/via/mfgtest.fth 329 fload ${BP}/cpu/x86/pc/olpc/via/testitems.fth 329 330 fload ${BP}/cpu/x86/pc/olpc/via/bootmenu.fth 330 331 -
cpu/x86/pc/olpc/via/mfgtest.fth
r2475 r2686 5 5 h# 07e0 constant mfg-color-green 6 6 7 : flush-keyboard ( -- ) begin key? while key drop repeat ; 7 : blank-screen ( -- ) 8 h# ffff ( color ) 9 0 0 ( color x y ) 10 screen-wh ( color x y w y ) 11 fill-rectangle-noff ( ) 12 ; 13 14 : clear-n-restore-scroller ( -- ) 15 blank-screen 16 restore-scroller 17 ; 8 18 9 19 : sq-border! ( bg -- ) current-sq sq >border ! ; … … 25 35 key? if key drop refresh exit then 26 36 mouse-ih if 27 10 get-eventif37 mouse-event? if 28 38 \ Ignore movement, act only on a button down event 29 39 nip nip if wait-buttons-up refresh exit then … … 33 43 ; 34 44 35 : mfg-test-dev ( $ -- ) 36 restore-scroller 37 ??cr ." Testing " 2dup type cr ( $ ) 38 2dup locate-device if ( $ ) 39 2drop ." Can't find device node" cr exit ( -- ) 40 else 41 drop ( $ ) 42 then ( $ phandle ) 43 " selftest" execute-device-method if ( return-code ) 45 : mfg-test-result ( error? -- ) 46 if ( return-code ) 44 47 ?dup if ( return-code ) 45 48 ??cr ." Selftest failed. Return code = " .d cr … … 51 54 else ( ) 52 55 green-letters 53 ." Okay" cr56 ??cr ." Okay" cr 54 57 black-letters 55 58 mfg-color-green sq-border! 56 59 true to pass? 57 d# 2000 hold-message 60 d# 2000 hold-message drop 58 61 then 59 62 else 60 ." Selftest failed due to abort" cr63 ??cr ." Selftest failed due to abort" cr 61 64 mfg-color-red sq-border! 62 65 false to pass? … … 68 71 flush-keyboard 69 72 ; 70 71 : draw-error-border ( -- ) 72 mfg-color-red d# 20 d# 20 d# 1160 d# 820 d# 20 box 73 ; 74 75 icon: play.icon rom:play.565 76 icon: quit.icon rom:quit.565 77 icon: cpu.icon rom:cpu.565 78 icon: spi.icon rom:spi.565 79 icon: ram.icon rom:ram.565 80 icon: sdcard.icon rom:sdcard.565 81 icon: usb.icon rom:usb.565 82 icon: battery.icon rom:battery.565 83 icon: camera.icon rom:camera.565 84 icon: wifi.icon rom:wifi.565 85 icon: audio.icon rom:audio.565 86 icon: touchpad.icon rom:touchpad.565 87 icon: display.icon rom:display.565 88 icon: keyboard.icon rom:keyboard.565 89 icon: timer.icon rom:timer.565 90 icon: clock.icon rom:clock.565 91 icon: ebook.icon rom:ebook.565 92 icon: leds.icon rom:leds.565 73 : mfg-test-dev ( $ -- ) 74 clear-n-restore-scroller ( $ ) 75 ??cr ." Testing " 2dup type cr ( $ ) 76 2dup locate-device if ( $ ) 77 ." Can't find device node " type cr exit ( -- ) 78 else ( $ phandle ) 79 drop ( $ ) 80 then ( $ ) 81 " selftest" execute-device-method ( error? ) 82 mfg-test-result 83 ; 93 84 94 85 : all-tests-passed ( -- ) … … 102 93 ; 103 94 104 d# 15 value #mfgtests 105 d# 5 value #mfgcols 95 0 value #mfgtests 96 0 value #mfgcols 97 0 value #mfgrows 98 99 : #mfgtests++ ( -- ) #mfgtests 1+ to #mfgtests ; 100 101 0 value cur-col 102 0 value cur-row 103 : cur-col++ ( -- ) cur-col 1+ to cur-col ; 104 : cur-row++ ( -- ) cur-row 1+ to cur-row ; 105 : set-col-row ( row col -- ) to cur-col to cur-row ; 106 : add-icon ( -- ) 107 cur-col #mfgcols = if 108 cur-row++ cur-row #mfgcols >= if abort" Too many icons" then 109 0 to cur-col 110 then 111 cur-row cur-col install-icon 112 cur-col++ 113 ; 106 114 107 115 : mfg-test-autorunner ( -- ) \ Unattended autorun of all tests … … 114 122 loop 115 123 ; 124 125 icon: play.icon rom:play.565 126 icon: quit.icon rom:quit.565 116 127 117 128 : play-item ( -- ) \ Interactive autorun of all tests … … 129 140 130 141 : quit-item ( -- ) menu-done ; 131 : cpu-item ( -- ) " /cpu" mfg-test-dev ;132 : battery-item ( -- ) " /battery" mfg-test-dev ;133 : spiflash-item ( -- ) " /flash" mfg-test-dev ;134 : memory-item ( -- ) " /memory" mfg-test-dev ;135 : usb-item ( -- ) " /usb" mfg-test-dev ;136 : int-sd-item ( -- ) " int:0" mfg-test-dev ;137 : ext-sd-item ( -- ) " ext:0" mfg-test-dev ;138 : rtc-item ( -- ) " /rtc" mfg-test-dev ;139 : display-item ( -- ) " /display" mfg-test-dev ;140 : audio-item ( -- ) " /audio" mfg-test-dev ;141 : camera-item ( -- ) " /camera" mfg-test-dev ;142 : wlan-item ( -- ) " /wlan" mfg-test-dev ;143 : timer-item ( -- ) " /timer" mfg-test-dev ;144 : touchpad-item ( -- ) " /8042/mouse" mfg-test-dev ;145 : keyboard-item ( -- ) " /8042/keyboard" mfg-test-dev ;146 : switch-item ( -- ) " /switches" mfg-test-dev ;147 : leds-item ( -- ) " /leds" mfg-test-dev ;148 149 : olpc-menu-items ( -- )150 clear-menu151 152 \ " CPU"153 \ ['] cpu-item cpu.icon 1 0 install-icon154 155 " SPI Flash: Contains EC code, firmware, manufacturing data."156 ['] spiflash-item spi.icon 1 0 install-icon157 158 " RAM chips"159 ['] memory-item ram.icon 1 1 install-icon160 161 " Internal mass storage"162 ['] int-sd-item sdcard.icon 1 2 install-icon163 164 " Plug-in SD card"165 ['] ext-sd-item sdcard.icon 1 3 install-icon166 167 " Wireless LAN"168 ['] wlan-item wifi.icon 1 4 install-icon169 170 " Display"171 ['] display-item display.icon 2 0 install-icon172 173 " Camera"174 ['] camera-item camera.icon 2 1 install-icon175 176 " Audio: Speaker and microphone"177 ['] audio-item audio.icon 2 2 install-icon178 179 " Battery"180 ['] battery-item battery.icon 2 3 install-icon181 182 " RTC (Real-Time Clock)"183 ['] rtc-item clock.icon 2 4 install-icon184 185 " USB ports"186 ['] usb-item usb.icon 3 0 install-icon187 188 \ These are last because they require user participation.189 \ The earlier tests are all included in automatic batch-mode.190 191 " Keyboard"192 ['] keyboard-item keyboard.icon 3 1 install-icon193 194 " Touchpad"195 ['] touchpad-item touchpad.icon 3 2 install-icon196 197 " LEDs"198 ['] leds-item leds.icon 3 3 install-icon199 200 " Switches"201 ['] switch-item ebook.icon 3 4 install-icon202 ;203 142 204 143 : init-menu ( -- ) 205 d# 4 to rows 144 ?open-screen ?open-mouse 145 #mfgrows to rows 206 146 #mfgcols to cols 207 147 d# 180 to sq-size … … 211 151 ; 212 152 153 defer test-menu-items 154 213 155 : full-menu ( -- ) 214 156 init-menu 215 olpc-menu-items 157 clear-menu 158 test-menu-items 216 159 217 160 " Run all non-interactive tests. (Press a key between tests to stop.)" … … 230 173 ['] mfg-test-autorunner to run-menu \ Run menu automatically 231 174 true to diag-switch? 232 ['] olpc-menu-items ['] nest-menu catch drop175 ['] test-menu-items ['] nest-menu catch drop 233 176 r> to run-menu 234 177 false to diag-switch? … … 236 179 ; 237 180 181 : autorun-from-gamekey ( -- ) 182 default-selection set-current-sq refresh 183 (cr kill-line 184 0 d# 30 do 185 i d# 10 mod 0= if (cr i d# 10 / .d then 186 mouse-event? dup if nip nip nip then ( moused? ) 187 key? or if ( ) 188 drop ( ) 189 menu-interact ( ) 190 unloop exit ( -- ) 191 then ( ) 192 d# 100 ms ( ) 193 -1 +loop 194 play-item 195 ; 196 : gamekey-auto-menu ( -- ) 197 ['] run-menu behavior >r 198 ['] autorun-from-gamekey to run-menu \ Run menu automatically after a timeout 199 (menu) 200 r> to run-menu 201 ; 238 202 239 203 \ LICENSE_BEGIN
Note: See TracChangeset
for help on using the changeset viewer.
