Commit Graph

42 Commits

Author SHA1 Message Date
Ron Evans 06ab3a836f machine/nrf: SPI master implementation
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-12-02 13:26:08 +01:00
Ayke van Laethem dbb3211485 wasm: add glue JS code
The file wasm_glue.js was copied from the Go wasm port and was modified,
most importantly to match the TinyGo calling convention.
2018-11-24 19:03:58 +01:00
Ayke van Laethem 1ba463c7ee machine: redesign I2C interface 2018-11-16 23:08:41 +01:00
Ayke van Laethem e5e09747f0 all: add WebAssembly backend 2018-10-21 19:47:47 +02:00
Ron Evans e4fa1a8288 nrf: I2C interface
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-10-05 12:50:43 +02:00
Ron Evans 4c8a725d78 avr: implement UART interface
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-10-01 12:02:59 +02:00
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>
2018-09-29 23:18:31 +02:00
Ron Evans 12fb4f3f91 avr: i2c implementation with BlinkM example
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-09-25 14:00:01 +02:00
Ron Evans 9df7d6e8e8 examples: add nrf example for all 4 built-in buttons and LEDs
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-09-22 15:17:47 +02:00
Ayke van Laethem 3e6750ae23 examples/test: make unicode example more interesting 2018-09-21 14:37:11 +02:00
Ayke van Laethem 486ea1b8ea examples: re-add hello world serial communication
I accidentally removed the serial example from 45348bfc3e while merging
commit 40f834d58f (PR: https://github.com/aykevl/tinygo/pull/12).
Force-pushing seemed like a bad idea so here it is.
2018-09-21 14:33:39 +02:00
Ayke van Laethem de694b5857 avr: set ADLAR bit in ADC to get a value scaled to 16-bit 2018-09-20 21:39:45 +02:00
Ron Evans 40f834d58f avr: ADC with 0-1023 range 2018-09-20 21:39:45 +02:00
Ron Evans 45348bfc3e examples: add hello world serial communication
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-09-19 22:38:29 +02:00
Ron Evans fc0ff3a987 avr: initial implementation for PWM
Signed-off-by: Ron Evans <ron@hybridgroup.com>

Edited slightly by Ayke van Laethem
2018-09-17 14:03:05 +02:00
Ayke van Laethem 2a20c0c7f0 all: rewrite sleep function
time.Sleep now compiles on all systems, so lets use that.
Additionally, do a few improvements in time unit handling for the
scheduler. This should lead to somewhat longer sleep durations without
wrapping (on some platforms).

Some examples got smaller, some got bigger. In particular, code using
the scheduler got bigger and the blinky1 example got smaller (especially
on Arduino: 380 -> 314 bytes).
2018-09-15 01:58:54 +02:00
Ayke van Laethem 152e12e4b0 all: implement iterating over hashmaps
Still no support for hashmaps > 8 entries, but this kind of works.
2018-09-15 00:29:34 +02:00
Ayke van Laethem 327076da39 examples/test: add slice-a-slice test 2018-09-14 21:02:29 +02:00
Ayke van Laethem 1387a1024d examples/test: small cleanup
I forgot to remove some commented out code...
2018-09-14 21:00:52 +02:00
Ron Evans ab6757fe11 avr: implement Get() function on AVR, and leave stubs for NRF and dummy machines
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-09-13 20:54:01 +02:00
Ayke van Laethem 8675025fc8 compiler: implement type assert without comma-ok 2018-09-11 19:51:31 +02:00
Ayke van Laethem 43b8c24226 compiler: implement interface assertions
This is a lot harder than 'regular' type assertions as the actual
methods need to be checked.
2018-09-06 20:18:18 +02:00
Ayke van Laethem 5aa8b71ae1 compiler: implement builtin copy(dst, src []T)
Not implemented: copying a string into a []byte slice.
2018-09-06 10:37:44 +02:00
Ayke van Laethem 094c5561b6 compiler: implement make([]T, ...) 2018-09-06 09:46:58 +02:00
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 58c87329d4 Implement closures and bound methods 2018-09-02 03:39:37 +02:00
Ayke van Laethem 58b853bbef Defer for trivial cases 2018-09-01 17:14:38 +02:00
Ayke van Laethem f9f92de1c3 Add a test for the unicode package
This massively increases .data size, possibly because loads of unused
globals are included. I'll need to investigate what's going on here. For
now, increase the RAM size for nrf chips (the nrf52 has 64kB of RAM).
2018-08-24 03:35:03 +02:00
Ayke van Laethem 179cf74b01 Implement package-global maps (of max 8 entries) 2018-08-24 00:56:20 +02:00
Ayke van Laethem 3a6ef38041 Preliminary implementation of a hashmap, unfinished
Missing features:
  * keys other than strings
  * more than 8 values in the hashmap
  * growing a map when needed
  * initial size hint
  * delete(m, key)
  * iterators (for range)
  * initializing global maps
  * ...more?
2018-08-22 04:50:24 +02:00
Ayke van Laethem 8b6cb204cd Basic support for slices 2018-08-18 20:06:35 +02:00
Ayke van Laethem 62c4c5e90b go fmt 2018-08-17 23:23:20 +02:00
Ayke van Laethem a97ca91c1f compiler: Implement interface calls
This is a big combined change. Other changes in this commit:

  * Analyze makeinterface and make sure type switches don't include
    unnecessary cases.
  * Do not include CGo wrapper functions in the analyzer callgraph.
    This also avoids some unnecessary type IDs.
  * Give all Go named structs a name in LLVM.
  * Use such a named struct for compiler-generated task data.
  * Use the type and function names defined by the ssa and types
    package instead of generating our own.
  * Some improvements to function pointers.
  * A few other minor improvements.

The one thing lacking here is interface-to-interface assertions.
2018-06-17 15:50:19 +02:00
Ayke van Laethem 0168bf7797 Add goroutines and function pointers 2018-06-07 14:48:24 +02:00
Ayke van Laethem 3a4663150e runtime: Implement GPIO output
Now we can actually blink a LED!
2018-04-27 01:29:13 +02:00
Ayke van Laethem 10427c2b6f Add blinky example (which doesn't blink a LED, yet) 2018-04-25 20:07:04 +02:00
Ayke van Laethem 217c48f933 Implement interfaces on the string type 2018-04-20 22:42:43 +02:00
Ayke van Laethem 3e3c3d259f Add rudimentary interface support 2018-04-19 20:33:10 +02:00
Ayke van Laethem 850fef9852 Add builtin len(string) 2018-04-19 20:24:01 +02:00
Ayke van Laethem 013b375904 Add type methods 2018-04-16 17:04:49 +02:00
Ayke van Laethem d555ad93d7 Add support for structs 2018-04-16 01:01:11 +02:00
Ayke van Laethem 5dfcb5f085 Reorganize packages 2018-04-15 03:38:01 +02:00