aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/runtime/runtime_stm32.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2018-09-22 01:51:44 +0200
committerAyke van Laethem <[email protected]>2018-09-22 01:51:44 +0200
commitdd5b5a381cf336ebdaf8fe1ac43fbf5d16c4aecd (patch)
treec8e7ae82c9e9a4de70267763ce47afa6c1f17389 /src/runtime/runtime_stm32.go
parent12298d23a776e2e8051e5b8f63591e7e5c9864c3 (diff)
downloadtinygo-dd5b5a381cf336ebdaf8fe1ac43fbf5d16c4aecd.tar.gz
tinygo-dd5b5a381cf336ebdaf8fe1ac43fbf5d16c4aecd.zip
stm32: initial support
Diffstat (limited to 'src/runtime/runtime_stm32.go')
-rw-r--r--src/runtime/runtime_stm32.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/runtime/runtime_stm32.go b/src/runtime/runtime_stm32.go
new file mode 100644
index 000000000..c2e6e2b1a
--- /dev/null
+++ b/src/runtime/runtime_stm32.go
@@ -0,0 +1,34 @@
+// +build stm32
+
+package runtime
+
+import (
+ "device/arm"
+)
+
+type timeUnit int64
+
+const tickMicros = 1 // TODO
+
+//go:export Reset_Handler
+func handleReset() {
+ main()
+}
+
+func init() {
+}
+
+func putchar(c byte) {
+ // TODO
+}
+
+func sleepTicks(d timeUnit) {
+ // TODO: use a real timer here
+ for i := 0; i < int(d/535); i++ {
+ arm.Asm("")
+ }
+}
+
+func ticks() timeUnit {
+ return 0 // TODO
+}