aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-02-25 15:31:15 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-03-21 15:02:47 +0100
commitcf69a59a3edefc3bea57cceea2cbedd25c7b680d (patch)
treef362a4518897f4625f98c05bd381369df9c665a6
parent95de9a103465dd122cd50250d88e1cbe34dc4bde (diff)
downloadSLOF-cf69a59a3edefc3bea57cceea2cbedd25c7b680d.zip
SLOF-cf69a59a3edefc3bea57cceea2cbedd25c7b680d.tar.gz
SLOF-cf69a59a3edefc3bea57cceea2cbedd25c7b680d.tar.bz2
Use common timebase and delay code in all boards.
There is a file called timebase.fs in the common code folder already, so there is no need to duplicate the delay functions in the board directories, too. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r--board-js2x/slof/OF.fs8
-rw-r--r--slof/fs/timebase.fs9
2 files changed, 8 insertions, 9 deletions
diff --git a/board-js2x/slof/OF.fs b/board-js2x/slof/OF.fs
index 908b268..894f43a 100644
--- a/board-js2x/slof/OF.fs
+++ b/board-js2x/slof/OF.fs
@@ -207,13 +207,7 @@ d# 14318378 VALUE tb-frequency \ default value - needed for "ms" to work
#include "helper.fs"
260 cp
-: tb@ BEGIN tbu@ tbl@ tbu@ rot over <> WHILE 2drop REPEAT
- 20 lshift swap ffffffff and or ;
-: milliseconds tb@ d# 1000 * tb-frequency / ;
-: ms milliseconds + BEGIN milliseconds over >= UNTIL drop ;
-: get-msecs ( -- n ) milliseconds ;
-\ : usecs tb@ d# 1000000 * tb-frequency / ;
-: us 999 + 1000 / ms ;
+#include <timebase.fs>
280 cp
diff --git a/slof/fs/timebase.fs b/slof/fs/timebase.fs
index 863f694..00a0bd2 100644
--- a/slof/fs/timebase.fs
+++ b/slof/fs/timebase.fs
@@ -11,8 +11,13 @@
\ ****************************************************************************/
\ Define all timebase related words
-: milliseconds ( -- ms ) tbl@ d# 1000 * tb-frequency / ;
-: microseconds ( -- us ) tbl@ d# 1000000 * tb-frequency / ;
+: tb@ ( -- tb )
+ BEGIN tbu@ tbl@ tbu@ rot over <> WHILE 2drop REPEAT
+ 20 lshift swap ffffffff and or
+;
+
+: milliseconds ( -- ms ) tb@ d# 1000 * tb-frequency / ;
+: microseconds ( -- us ) tb@ d# 1000000 * tb-frequency / ;
: ms ( ms-to-wait -- ) milliseconds + BEGIN milliseconds over >= UNTIL drop ;
: get-msecs ( -- n ) milliseconds ;