aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/common/lib/hardware/xonxoff.frt
diff options
context:
space:
mode:
Diffstat (limited to 'amforth-6.5/common/lib/hardware/xonxoff.frt')
-rw-r--r--amforth-6.5/common/lib/hardware/xonxoff.frt27
1 files changed, 27 insertions, 0 deletions
diff --git a/amforth-6.5/common/lib/hardware/xonxoff.frt b/amforth-6.5/common/lib/hardware/xonxoff.frt
new file mode 100644
index 0000000..d6a59d9
--- /dev/null
+++ b/amforth-6.5/common/lib/hardware/xonxoff.frt
@@ -0,0 +1,27 @@
+\
+\ enrich the serial IO with XON/XOFF
+\ this is not a complete and fool-proof
+\
+
+\ #requires is.frt
+
+$11 constant XON
+$13 constant XOFF
+
+\ original refill
+variable xt-refill
+
+: refill-xon
+ XON emit
+ xt-refill @ execute
+ XOFF emit
+;
+
+: +xonxoff
+ ['] refill defer@ xt-refill !
+ ['] refill-xon is refill
+;
+
+: -xonxoff
+ xt-refill @ is refill
+;