[openfirmware] r1307 - ofw/core
svn at openfirmware.info
svn at openfirmware.info
Thu Aug 20 08:24:08 CEST 2009
Author: wmb
Date: 2009-08-20 08:24:07 +0200 (Thu, 20 Aug 2009)
New Revision: 1307
Modified:
ofw/core/ofwcore.fth
Log:
Added "stdin-idle" hook for reducing power consumption; you can set
it to call for example x86 halt.
Modified: ofw/core/ofwcore.fth
===================================================================
--- ofw/core/ofwcore.fth 2009-08-20 06:21:29 UTC (rev 1306)
+++ ofw/core/ofwcore.fth 2009-08-20 06:24:07 UTC (rev 1307)
@@ -2946,6 +2946,8 @@
nuser pending-char
nuser char-pending?
+defer stdin-idle ' noop is stdin-idle \ Hook for power savings
+
: "read" ( -- adr len ) " read" ; \ Space savings
: "write" ( -- adr len ) " write" ; \ Space savings
: stdin-getchar ( -- okay? )
@@ -2962,7 +2964,10 @@
char-pending? @ if
pending-char c@ char-pending? off
else
- begin stdin-getchar until
+ begin
+ stdin-getchar
+ dup 0= if stdin-idle then
+ until
pending-char c@
then
;
More information about the openfirmware
mailing list