aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Wagner <andreas.wagner@lowfatcomputing.org>2014-11-06 16:39:46 -0500
committerJames Cameron <quozl@laptop.org>2016-12-28 21:41:12 +1100
commite55edc7412a9e30bd741411439716d9541208a9b (patch)
treec9a3378065c132a0e89fdf761699c38ca75bd747
parentf6c951f11c200e2918176af9936a6489a9f8367a (diff)
downloadcforth-e55edc7412a9e30bd741411439716d9541208a9b.tar.gz
Add DAC support
-rw-r--r--src/app/arm-teensy3/app.fth25
-rw-r--r--src/platform/arm-teensy3/textend.c22
2 files changed, 25 insertions, 22 deletions
diff --git a/src/app/arm-teensy3/app.fth b/src/app/arm-teensy3/app.fth
index 749339f..46e806b 100644
--- a/src/app/arm-teensy3/app.fth
+++ b/src/app/arm-teensy3/app.fth
@@ -6,18 +6,19 @@ fl ../../lib/dl.fth
#0 ccall: spins { i.nspins -- }
#1 ccall: wfi { -- }
#2 ccall: get-msecs { -- n }
-#3 ccall: a@ { i.pin -- n }
-#4 ccall: p! { i.val i.pin -- }
-#5 ccall: p@ { i.pin -- n }
-#6 ccall: m! { i.mode i.pin -- }
-#7 ccall: get-usecs { -- n }
-#8 ccall: delay { n -- }
-#9 ccall: bye { -- }
-#10 ccall: /nv { -- n }
-#11 ccall: nv-base { -- n }
-#12 ccall: nv-length { -- n }
-#13 ccall: nv@ { i.adr -- i.val }
-#14 ccall: nv! { i.val i.adr -- }
+#3 ccall: a! { n i.pin -- }
+#4 ccall: a@ { i.pin -- n }
+#5 ccall: p! { i.val i.pin -- }
+#6 ccall: p@ { i.pin -- n }
+#7 ccall: m! { i.mode i.pin -- }
+#8 ccall: get-usecs { -- n }
+#9 ccall: delay { n -- }
+#10 ccall: bye { -- }
+#11 ccall: /nv { -- n }
+#12 ccall: nv-base { -- n }
+#13 ccall: nv-length { -- n }
+#14 ccall: nv@ { i.adr -- i.val }
+#15 ccall: nv! { i.val i.adr -- }
fl ../../platform/arm-teensy3/watchdog.fth
fl ../../platform/arm-teensy3/timer.fth
diff --git a/src/platform/arm-teensy3/textend.c b/src/platform/arm-teensy3/textend.c
index 0be78b3..561e9bb 100644
--- a/src/platform/arm-teensy3/textend.c
+++ b/src/platform/arm-teensy3/textend.c
@@ -9,6 +9,7 @@
cell get_msecs();
cell wfi();
cell spins();
+cell analogWriteDAC0();
cell analogRead();
cell digitalWrite();
cell digitalRead();
@@ -23,16 +24,17 @@ cell eeprom_read_byte();
cell eeprom_write_byte();
cell ((* const ccalls[])()) = {
- (cell (*)())spins, // Entry # 0
- (cell (*)())wfi, // Entry # 1
- (cell (*)())get_msecs, // Entry # 2
- (cell (*)())analogRead, // Entry # 3
- (cell (*)())digitalWrite, // Entry # 4
- (cell (*)())digitalRead, // Entry # 5
- (cell (*)())pinMode, // Entry # 6
- (cell (*)())micros, // Entry # 7
- (cell (*)())delay, // Entry # 8 // fixme: hangs
- (cell (*)())_reboot_Teensyduino_, // Entry # 9
+ (cell (*)())spins, // Entry # 0
+ (cell (*)())wfi, // Entry # 1
+ (cell (*)())get_msecs, // Entry # 2
+ (cell (*)())analogWriteDAC0, // Entry # 3
+ (cell (*)())analogRead, // Entry # 4
+ (cell (*)())digitalWrite, // Entry # 5
+ (cell (*)())digitalRead, // Entry # 6
+ (cell (*)())pinMode, // Entry # 7
+ (cell (*)())micros, // Entry # 8
+ (cell (*)())delay, // Entry # 9 // fixme: hangs
+ (cell (*)())_reboot_Teensyduino_, // Entry # 10
(cell (*)())eeprom_size,
(cell (*)())eeprom_base,
(cell (*)())eeprom_length,