Changeset 3400
- Timestamp:
- Oct 31, 2012 12:26:46 AM (7 months ago)
- File:
-
- 1 edited
-
dev/olpc/kb3700/batstat.fth (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dev/olpc/kb3700/batstat.fth
r2654 r3400 1 1 : wextend ( w -- n ) dup h# 8000 and if h# ffff.0000 or then ; 2 \ Base unit for temperature is 1/256degrees C3 : > degrees-c 7 rshift 1+ 2/ ; \ Round to nearest degree2 \ Base unit for temperature is .125 degrees C 3 : >milli-degrees-c 125 * 5 rshift ; 4 4 : uvolt@ bat-voltage@ d# 9760 d# 32 */ ; 5 5 : cur@ bat-current@ wextend d# 15625 d# 120 */ ; 6 : pcb-temp ambient-temp@ >degrees-c ;7 : bat-temp bat-temp@ > degrees-c ;6 \ : pcb-temp ambient-temp@ >milli-degrees-c ; 7 : bat-temp bat-temp@ >milli-degrees-c ; 8 8 : soc bat-soc@ ; 9 9 … … 80 80 ; 81 81 82 : .bat-temp 83 push-decimal 84 bat-temp 85 dup abs d# 50 + d# 100 / <# u# [char] . hold u#s swap sign u#> type 86 pop-base 87 ; 88 82 89 : .% ( n -- ) push-decimal <# [char] % hold u# u#s u#> type pop-base ; 83 90 : .bat ( -- ) … … 94 101 uvolt@ .milli ." V " 95 102 cur@ .milli ." A " 96 bat-temp 2.d." C "103 .bat-temp ." C " 97 104 dup 2 and if ." full " then 98 105 dup 4 and if ." low " then
Note: See TracChangeset
for help on using the changeset viewer.
