Changeset 3451


Ignore:
Timestamp:
Nov 22, 2012, 8:13:47 AM (2 years ago)
Author:
quozl
Message:

OLPC XO-4 - LEDs selftest, try to light all LEDs together until spacebar is pressed, or ten seconds has elapsed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpu/arm/olpc/cl4/leds.fth

    r3393 r3451  
    2727: hdd-led-toggle  ( -- )  led-storage-gpio# gpio-pin@  if  hdd-led-off  else  hdd-led-on  then  ;
    2828
    29 : selftest  ( -- )
    30     ." Flashing LEDs" cr
    31 
    32    d# 10 0 do  ols-led-on d# 200 ms ols-led-off d# 200 ms  loop
     29: (cycle)
     30   ols-led-on
     31   d# 100 ms
     32   hdd-led-on
     33   " /wlan:quiet" test-dev
     34   d# 100 ms
     35   ols-led-off
    3336   ols-led-ec-control
    3437   ols-assy-mode-on
     38   d# 100 ms
     39   hdd-led-off
     40   ols-assy-mode-off
     41   d# 100 ms
     42;
    3543
    36    " /wlan:quiet" test-dev  " /wlan:quiet" test-dev  \ Twice for longer flashing
     44: (selftest)
     45   get-msecs d# 10000 +                 ( limit )
     46   begin
     47      (cycle)
     48      key?  if  drop exit  then
     49      dup get-msecs -  0<               ( limit timeout? )
     50   until                                ( limit )
     51   drop                                 ( )
     52;
    3753
    38    d# 20 0 do  hdd-led-on d# 100 ms hdd-led-off d# 100 ms  loop
    39    ols-assy-mode-off
    40 
     54: selftest  ( -- error? )
     55   ." Testing LEDs" cr
     56   (selftest)
    4157   confirm-selftest?
    4258;
Note: See TracChangeset for help on using the changeset viewer.