Author: quozl Date: Fri Sep 16 01:34:00 2011 New Revision: 2511 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2511
Log: OLPC XO-1.75 - add thermal sensor watch mode
Modified: cpu/arm/mmp2/thermal.fth
Modified: cpu/arm/mmp2/thermal.fth ============================================================================== --- cpu/arm/mmp2/thermal.fth Thu Sep 15 08:08:18 2011 (r2510) +++ cpu/arm/mmp2/thermal.fth Fri Sep 16 01:34:00 2011 (r2511) @@ -26,10 +26,22 @@ : wd-thresh@ ( -- n ) wd-thresh io@ ; : wd-thresh! ( n -- ) wd-thresh io! ;
+: .c ( n -- ) (.) type ." C " ; + : .thermal - ." degrees=" cpu-temperature .d - ." raw=" thermal-base io@ h# 3ff and . - ." threshold=" wd-thresh@ h# 3ff and . + push-decimal + time&date >unix-seconds . + ." limit: " wd-thresh@ h# 3ff and . + ." sensor: " thermal-base io@ h# 3ff and . + ." cpu: " cpu-temperature .c + ." battery: " bat-temp .c + pop-base +; + +: watch-thermal + begin + .thermal cr d# 1000 ms key? + until key drop cr ;
: test-thermal