aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Cameron <quozl@laptop.org>2016-12-28 21:33:15 +1100
committerJames Cameron <quozl@laptop.org>2016-12-28 21:41:12 +1100
commitbadf82ae1a31c26dc6080d733dc415cf866e7653 (patch)
tree91a3a86a432b1b327fb7e7e24324841d5a64d1a0
parente55edc7412a9e30bd741411439716d9541208a9b (diff)
downloadcforth-badf82ae1a31c26dc6080d733dc415cf866e7653.tar.gz
Fix non-volatile inhibit and a!
- on some units, pin 13 does not float high enough, so require shorting pin 13 and 14 to inhibit non-volatile buffer execution. - fix a! argument specification list, analogWriteADC0 takes only one argument.
-rw-r--r--src/app/arm-teensy3/app.fth13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/app/arm-teensy3/app.fth b/src/app/arm-teensy3/app.fth
index 46e806b..78fc93b 100644
--- a/src/app/arm-teensy3/app.fth
+++ b/src/app/arm-teensy3/app.fth
@@ -6,7 +6,7 @@ fl ../../lib/dl.fth
#0 ccall: spins { i.nspins -- }
#1 ccall: wfi { -- }
#2 ccall: get-msecs { -- n }
-#3 ccall: a! { n i.pin -- }
+#3 ccall: a! { i.val -- }
#4 ccall: a@ { i.pin -- n }
#5 ccall: p! { i.val i.pin -- }
#6 ccall: p@ { i.pin -- n }
@@ -69,11 +69,14 @@ fl ../../platform/arm-teensy3/nv.fth
$0 $d p! $0 $d m! \ drive off, mode input
;
-\ to prevent execution of non-volatile buffer, tie pin 13 to ground.
+\ to prevent execution of non-volatile buffer, tie pin 13 to pin 14.
: confirm? ( -- flag )
- $0 $d m! $1 $d p! $2 ms \ mode input, pullup on, stabilise
- $d p@ \ read pin
- $1 $d m! $0 $d p! \ mode output, force low
+ $0 $e m! \ set pin 14 to input
+ $1 $d m! $1 $d p! $2 ms \ force pin 13 high
+ $e p@ \ read pin
+ $0 $d p! $2 ms \ force low
+ $e p@ 0= \ read pin and invert
+ and 0=
;
: app