Ayke van Laethem
bdcac9ae42
Makefile: add gen-device-stm32 to gen-device target
6 years ago
Ayke van Laethem
ffa6d562a9
tools/gen-device-svd: fix bug in previous commit
There was a bug in the generated Go code: padding member numbers would
not increase their count leading to multiple struct members with the
same name.
6 years ago
Ayke van Laethem
a72d0b7959
tools/gen-device-svd: make sure all clusters are included
This is important for nrf52840, which has UART pin selection in a
cluster that wasn't exposed.
6 years ago
Ron Evans
4c8a725d78
avr: implement UART interface
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ayke van Laethem
bcf441ccba
docs: add another way in which a llvm-7-dev installation can fail
6 years ago
Ayke van Laethem
eac81e5232
Makefile: run verbose 'make test'
6 years ago
Ayke van Laethem
02936042b8
travis: add Travis CI build script
6 years ago
Ayke van Laethem
a2e57b40f9
docs: update installation instructions
* Update to system-installed LLVM.
* Avoid the use of make.
6 years ago
Ayke van Laethem
f107a24b72
all: use LLVM library provided by the system
6 years ago
Ayke van Laethem
5c79a93c85
tools/gen-device-svd: generate code for cluster arrays
This should make it possible to add support for PWM on nrf devices.
6 years ago
Ayke van Laethem
9b4a6dcc14
tools/gen-device-svd: move peripheral list to beginning
It's much easier to scan the source when the peripheral list is at the
front. Go doesn't care about the order of declaration anyway.
6 years ago
Ayke van Laethem
e77a5af5d2
tools/gen-device-svd: rewrite with ElementTree
xml.etree.ElementTree is much easier to work with. This also fixes a few
small bugs in the parser. And as an added bonus, device generation got a
lot faster: apprently etree is a lot faster than minidom.
6 years ago
Ron Evans
ee5d562050
examples: add color mood lamp that shows using GPIO, PWM, ADC, and I2C all at the same time on an Arduino
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ayke van Laethem
802350f8da
main: helpful error message for flash cmd without -target
6 years ago
Ayke van Laethem
b6db84e916
main: use GOPATH from the environment
Be more compatible with the Go toolchain by setting GOPATH in the same
way. This makes it possible to flash and run examples from the standard
GOPATH instead of only from the source tree.
6 years ago
Ayke van Laethem
5bf058a0a6
nrf: fix off-by-one in modulo of runtime.ticks
This code:
foo & 0xffffff
Is equivalent to this code:
foo % 0x1000000
However, to drop the high 8 bits, this calculation was used:
foo % 0xffffff
This is far more expensive (and incorrect), as it needs an actual modulo
operation which increases code size and probably reduces speed on a
Cortex-M4 and needs library functions for a Cortex-M0 increasing code
size by a much bigger amount.
6 years ago
Ayke van Laethem
c1a833c7cc
main: add basic float tests
6 years ago
Ayke van Laethem
717262c0a6
main: add coroutine/sleep tests
6 years ago
Ayke van Laethem
318567f398
ir: fix nil pointer dereference in IsVolatile
6 years ago
Ayke van Laethem
8d170d3bd2
all: change special type __volatile to pragma //go:volatile
This is one step towards removing unnecessary special casts in most
cases. It is also part of removing as much magic as possible from the
compiler (the pragma is explicit, the special name is not).
6 years ago
Ayke van Laethem
0e813c4cb7
main: add -no-debug flag to avoid DWARF debug info
6 years ago
Ayke van Laethem
69f2cec045
avr: fix build for Arduino
I'm afraid I broke this while merging the I2S changes...
6 years ago
Ayke van Laethem
8f661d25a9
main_test: fix error logging of test
6 years ago
Ayke van Laethem
4731f2f787
testdata: add better tests for struct expanding
6 years ago
Ron Evans
12fb4f3f91
avr: i2c implementation with BlinkM example
Signed-off-by: Ron Evans <ron@hybridgroup.com>
6 years ago
Ayke van Laethem
d190bfccf6
Makefile: add 'make test' that runs go test
6 years ago
Ayke van Laethem
13cb7d6503
avr: add interrupt support
Interrupts are supported using a special //go:interrupt pragma.
For example:
//go:interrupt INT0_vect
func handleINT0() {
// do something here
}
6 years ago
Ayke van Laethem
dc88948f55
Makefile: go fmt testdata/*.go
6 years ago
Ayke van Laethem
174b6333f8
compiler: fix expanding zero-length structs
6 years ago
Ayke van Laethem
d8f0ddf3fa
main: add tests
Add testing infrastructure and one initial test (for
src/runtime/print.go). More tests to be added later.
6 years ago
Ayke van Laethem
ed227b8fd3
all: fix errors reported by go vet
6 years ago
Ayke van Laethem
a2eaaa42a0
main: optimize 'tinygo run'
Apparently -Oz without inliner is the fastest, probably because it
removes code that would otherwise need to be emitted.
TODO: does this mean that the ExecutionEngine compiles the module before
running it? Can we control this?
6 years ago
Ayke van Laethem
c9ae72a105
all: allow -O0 optimization level
6 years ago
Ayke van Laethem
6191d4e1ac
compiler: rename .Parse() to .Compiler()
The fact it was called Parse() is more of a historical accident, as the
compiler started out using the Go AST directly instead of Go SSA.
6 years ago
Ayke van Laethem
1b229a8f8b
compiler: support compiling individual .go files
For example:
tinygo run ./src/examples/test/test.go
6 years ago
Ayke van Laethem
a561e9a9ac
ir: move adding packages from the compiler
6 years ago
Ayke van Laethem
9df04a2170
compiler: fix panic on import errors
I think this is a problem in the loader package - it doesn't seem to
return errors for missing packages.
6 years ago
Ayke van Laethem
8a468786df
compiler: use config struct for options
6 years ago
Ayke van Laethem
ddd4a39cb8
avr: fix default handler in interrupt vector
Apparently the target of a weak symbol must be defined in the same file
as where it is used as a weak symbol.
https://www.avrfreaks.net/forum/using-weak-custom-vector-table#comment-745922
6 years ago
Ayke van Laethem
fd6dda5e4f
main: run the compiler from any path
6 years ago
Ayke van Laethem
453450f40d
ir: sort function pragmas
6 years ago
Ayke van Laethem
3076ad470e
tools/gen-device-svd: fix script filename in output
6 years ago
Ayke van Laethem
b09f7a5e6c
avr: make linker script generic
6 years ago
Ayke van Laethem
b9638315d2
avr: automatically generate interrupt vectors
6 years ago
Ayke van Laethem
3850530c88
docs/installation: fix LLVM hyperlink
6 years ago
Ayke van Laethem
3e1a60351d
docs/internals: fix hyperlink
6 years ago
Ayke van Laethem
7c597c910f
README: move installation instructions to docs
6 years ago
Ayke van Laethem
4868823dad
README: add docs badge
6 years ago
Ayke van Laethem
c9a2b3f417
docs: remove "Indices and tables"
6 years ago
Ayke van Laethem
f7f33a1163
docs: add initial documentation
6 years ago