Changeset 3477


Ignore:
Timestamp:
Dec 7, 2012, 2:22:53 AM (2 years ago)
Author:
quozl
Message:

OLPC XO-4 - add EC 16-bit battery status command, rework to allow automatic upgrade from Q7B07 EC 0.3.04, reported by Chia-Hsiu

Location:
dev/olpc/kb3700
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • dev/olpc/kb3700/eccmdcom.fth

    r3472 r3477  
    2424: mppt-on        ( -- )    h# 41 ec-cmd  ;
    2525: vin@           ( -- b )  h# 42 ec-cmd-w@  ;
    26 : bat-status16@  ( -- w )  h# 70 ec-cmd-w@  ;
    2726
    28 defer bat-status@
     27defer bat-status@  ( -- w )
    2928' bat-status8@  is bat-status@
    30 
    31 [ifdef] olpc-xo4
    32 ' bat-status16@  is bat-status@
    33 [then]
    34 
    3529
    3630\ LICENSE_BEGIN
  • dev/olpc/kb3700/eccmds.fth

    r2957 r3477  
    3131: ec-cmd-l!  ( l cmd -- )   >r lbsplit 4 0 r> do-ec-cmd  ;
    3232
    33 fload ${BP}/dev/olpc/kb3700/eccmdcom.fth  \ Common commands 
     33fload ${BP}/dev/olpc/kb3700/eccmdcom.fth  \ Common commands
    3434
    3535\ Commands that are different for XO-1.75
     
    113113[then]
    114114
     115\ Commands that are different for XO-4
     116
     117: bat-status16@  ( -- w )  h# 70 ec-cmd-w@  ;
     118[ifdef] olpc-xo4
     119' bat-status16@  is bat-status@
     120[then]
     121
     122\ until EC 0.3.04 and earlier are purged from prototype population,
     123\ choose command based on API version reported by EC.
     124: bat-status@'  ( -- w )
     125   ec-api-ver@  5 <  if
     126      ['] bat-status8@
     127   else
     128      ['] bat-status16@
     129   then
     130   is bat-status@
     131   bat-status@
     132;
     133' bat-status@'  is bat-status@
     134
    115135\ LICENSE_BEGIN
    116136\ Copyright (c) 2010 FirmWorks
Note: See TracChangeset for help on using the changeset viewer.