Commit Graph

27 Commits

Author SHA1 Message Date
Ayke van Laethem 9101ea11bf examples: clean up examples and add blinky1 for Arduino
Arduino has trouble supporting anything that's not extremely simple, so
add a simple blinky example for it. Also, it may be useful anyway.
2018-09-05 16:40:46 +02:00
Ayke van Laethem 17b5b6ec5b all: use less magic in memory-mapped IO
Don't store addresses in the values of registers, this leads to problems
with char arrays (among others). Instead, do it like it's done in C with
raw addresses cast to struct pointers.

This commit also splits gen-device.py, as AVR and ARM have very
different ideas of what a register is. It's easier to just keep them
separate.
2018-09-05 12:18:21 +02:00
Ayke van Laethem 93248c93ed avr: remove device files, use them from a subrepository
These files don't really belong in this repository. It's better to
generate them automatically from a source, like the one provided by the
avr-rust project. So a new command `make gen-device-avr` has been
provided for this purpose.
2018-09-05 12:13:33 +02:00
Ayke van Laethem 92877f8371 Makefile: some cleanups
Remove $(GCC) and $(LLC) which were not used anymore, and display binary
size even when building for the host.
2018-09-04 21:32:56 +02:00
Ayke van Laethem 0746d61639 compiler: move optimizer into the binary 2018-09-04 19:20:49 +02:00
Ayke van Laethem d4f5700625 Remove use of CGo in the runtime
CGo depends on syscall, which (in the standard library) depends on sync,
which depends on the runtime. There are also other import cycles. To be
able to use the syscall package from upstream, stop using CGo.
2018-08-29 20:01:33 +02:00
Ayke van Laethem 5f28b07f75 Enable aggressive code size optimizations: -Oz 2018-08-24 03:35:39 +02:00
Ayke van Laethem ab3358e5a3 Add make fmt 2018-08-24 02:59:18 +02:00
Ayke van Laethem a30ffa5c1e Revert "Move coroutine passes from Makefile to compiler itself"
This reverts commit d9ca5f97fb.

There is a problem with coroutines that I haven't solved yet. Reverting
makes it work, for now.

Also, use a better coroutines flag for the LLVM opt tool.
2018-08-20 20:24:54 +02:00
Ayke van Laethem d9ca5f97fb Move coroutine passes from Makefile to compiler itself
This is much more convenient.
2018-08-20 04:31:01 +02:00
Ayke van Laethem 90fb0ee4eb Add AVR support
This requires support in LLVM, as AVR support is still experimental. For
example, in bindings/go/build.sh, add
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR to cmake_flags.
2018-06-07 18:35:54 +02:00
Ayke van Laethem 0d1b7239c1 Assorted allocator fixes 2018-06-07 18:24:31 +02:00
Ayke van Laethem b8260ba554 Makefile: use -Os instead of -O1
This was left over from debugging.
2018-06-07 18:22:28 +02:00
Ayke van Laethem 0168bf7797 Add goroutines and function pointers 2018-06-07 14:48:24 +02:00
Ayke van Laethem 8df220a53b Move to my own fork of LLVM 2018-06-07 13:20:09 +02:00
Ayke van Laethem 588910792d Translate bootstrapping main from C to LLVM IR
This avoids needing a C compiler for every platform.
2018-06-03 17:38:16 +02:00
Ayke van Laethem 2fca772431 Makefile: Autodetect LLVM bin dir 2018-05-28 09:01:35 +02:00
Ayke van Laethem 8c426b406d Automatically convert .svd files to Go source files 2018-05-05 19:02:43 +02:00
Ayke van Laethem 5bbd41e9fb compiler: Implement -ffunction-sections work 2018-04-27 01:28:14 +02:00
Ayke van Laethem 4522d2f49e Makefile: Remove SECONDARY: rule
For some reason it isn't necessary anymore.
2018-04-26 23:50:01 +02:00
Ayke van Laethem 2d19bb11ba compiler: Merge the runtime into the Go code, for better code size 2018-04-26 18:06:54 +02:00
Ayke van Laethem a446b4de97 Be able to actually run the blinky example on an nRF
runtime.Sleep() doesn't work yet so it prints a lot of data. Also, this
depends on a small patch to nrfx.
2018-04-25 20:35:19 +02:00
Ayke van Laethem 45e7376f39 Implement print() and println() in Go 2018-04-20 16:32:40 +02:00
Ayke van Laethem 5dfcb5f085 Reorganize packages 2018-04-15 03:38:01 +02:00
Ayke van Laethem 30931ab3a6 Makefile cleanup 2018-04-13 02:12:36 +02:00
Ayke van Laethem d08ff64d1d Move string printing to runtime 2018-04-11 20:41:09 +02:00
Ayke van Laethem bc28975c8c Hello world! 2018-04-11 16:17:14 +02:00