[openfirmware] r1568 - dev/olpc/kb3700

svn at openfirmware.info svn at openfirmware.info
Fri Dec 11 06:15:35 CET 2009


Author: wmb
Date: 2009-12-11 06:15:35 +0100 (Fri, 11 Dec 2009)
New Revision: 1568

Modified:
   dev/olpc/kb3700/battery.fth
Log:
OLPC battery test - eliminated timeouts for SMT operator convenience,
eliminated AC disconnect test in SMT phase.


Modified: dev/olpc/kb3700/battery.fth
===================================================================
--- dev/olpc/kb3700/battery.fth	2009-12-11 05:13:41 UTC (rev 1567)
+++ dev/olpc/kb3700/battery.fth	2009-12-11 05:15:35 UTC (rev 1568)
@@ -796,15 +796,20 @@
 
 : wait-no-ac  ( -- error? )
    ." Disconnect AC power to continue.. "
-   d# 200 0  do
+   begin
+      bat-status@ h# 10 and   ( ac-connected? )
+   while
       d# 100 ms
-      bat-status@ h# 10 and  0=  if
-         false unloop cr exit
+
+      key?  if
+         key  h# 1b =  if
+            ." ERROR: AC still connected" cr
+            true  exit
+         then
       then
-   loop
+   repeat
    cr
-   ." ERROR: AC not disconnected" cr
-   true
+   false
 ;
 
 \ Test that we can run without AC power.
@@ -825,15 +830,20 @@
 
 : wait-ac  ( -- error? )
    ." Connect AC power to continue.. "
-   d# 200 0  do
+   begin
+      bat-status@ h# 10 and  0=  ( ac-disconnected? )
+   while
       d# 100 ms
-      bat-status@ h# 10 and  if
-         false unloop cr exit
+      
+      key?  if
+         key  h# 1b =  if
+            ." ERROR: AC not connected" cr
+            true  exit
+         then
       then
-   loop
+   repeat
    cr
-   ." ERROR: AC not connected" cr
-   true
+   false
 ;
 
 : test-charging  ( -- error? )
@@ -853,7 +863,9 @@
 
 : interactive-test  ( -- error? )
    test-battery      if  true exit  then
-   test-discharging  if  true exit  then
+   smt-test? 0=   if   \ Skip this test in SMT
+      test-discharging  if  true exit  then
+   then
    test-charging     if  true exit  then
    false
 ;




More information about the openfirmware mailing list