Skip to content

Commit 74429b4

Browse files
committed
targets: rename arduino target to arduino-uno
Rename the "arduino" target to "arduino-uno" to better reflect the board it represents. The "arduino" name is kept as an alias that inherits from "arduino-uno" for backward compatibility. - Rename targets/arduino.json to targets/arduino-uno.json - Create targets/arduino.json as alias inheriting from arduino-uno - Rename board_arduino.go to board_arduino_uno.go - Update build tag from "arduino" to "arduino_uno" - Rename corresponding example files Signed-off-by: deadprogram <ron@hybridgroup.com>
1 parent bcb191c commit 74429b4

File tree

9 files changed

+32
-18
lines changed

9 files changed

+32
-18
lines changed

GNUmakefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ smoketest: testchdir
634634
@$(MD5SUM) test.hex
635635
# test simulated boards on play.tinygo.org
636636
ifneq ($(WASM), 0)
637-
GOOS=js GOARCH=wasm $(TINYGO) build -size short -o test.wasm -tags=arduino examples/blinky1
637+
GOOS=js GOARCH=wasm $(TINYGO) build -size short -o test.wasm -tags=arduino_uno examples/blinky1
638638
@$(MD5SUM) test.wasm
639639
GOOS=js GOARCH=wasm $(TINYGO) build -size short -o test.wasm -tags=hifive1b examples/blinky1
640640
@$(MD5SUM) test.wasm
@@ -898,13 +898,13 @@ endif
898898
@$(MD5SUM) test.hex
899899
$(TINYGO) build -size short -o test.hex -target=atmega1284p examples/machinetest
900900
@$(MD5SUM) test.hex
901-
$(TINYGO) build -size short -o test.hex -target=arduino examples/blinky1
901+
$(TINYGO) build -size short -o test.hex -target=arduino-uno examples/blinky1
902902
@$(MD5SUM) test.hex
903903
$(TINYGO) build -size short -o test.hex -target=arduino-leonardo examples/blinky1
904904
@$(MD5SUM) test.hex
905-
$(TINYGO) build -size short -o test.hex -target=arduino examples/pwm
905+
$(TINYGO) build -size short -o test.hex -target=arduino-uno examples/pwm
906906
@$(MD5SUM) test.hex
907-
$(TINYGO) build -size short -o test.hex -target=arduino -scheduler=tasks examples/blinky1
907+
$(TINYGO) build -size short -o test.hex -target=arduino-uno -scheduler=tasks examples/blinky1
908908
@$(MD5SUM) test.hex
909909
$(TINYGO) build -size short -o test.hex -target=arduino-mega1280 examples/blinky1
910910
@$(MD5SUM) test.hex

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func main() {
3737
The above program can be compiled and run without modification on an Arduino Uno, an Adafruit ItsyBitsy M0, or any of the supported boards that have a built-in LED, just by setting the correct TinyGo compiler target. For example, this compiles and flashes an Arduino Uno:
3838

3939
```shell
40-
tinygo flash -target arduino examples/blinky1
40+
tinygo flash -target arduino-uno examples/blinky1
4141
```
4242

4343
## WebAssembly
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build arduino
1+
//go:build arduino_uno
22

33
package main
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build arduino
1+
//go:build arduino_uno
22

33
package main
44

src/examples/pwm/pico2.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//go:build pico2 || pico_plus2
2+
3+
package main
4+
5+
import "machine"
6+
7+
var (
8+
pwm = machine.PWM0 // Pin 25 (LED on pico2) corresponds to PWM0.
9+
//pinA = machine.LED
10+
pinA = machine.GPIO16
11+
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build arduino
1+
//go:build arduino_uno
22

33
package machine
44

src/machine/board_atmega328p.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build (avr && atmega328p) || arduino || arduino_nano
1+
//go:build (avr && atmega328p) || arduino_uno || arduino_nano
22

33
package machine
44

targets/arduino-uno.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"inherits": ["atmega328p"],
3+
"build-tags": ["arduino_uno"],
4+
"ldflags": [
5+
"--defsym=_bootloader_size=512",
6+
"--defsym=_stack_size=512"
7+
],
8+
"flash-command": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}:i",
9+
"serial-port": ["2341:0043", "2341:0001", "2a03:0043", "2341:0243"],
10+
"emulator": "simavr -m atmega328p -f 16000000 {}"
11+
}

targets/arduino.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
{
2-
"inherits": ["atmega328p"],
3-
"build-tags": ["arduino"],
4-
"ldflags": [
5-
"--defsym=_bootloader_size=512",
6-
"--defsym=_stack_size=512"
7-
],
8-
"flash-command": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}:i",
9-
"serial-port": ["2341:0043", "2341:0001", "2a03:0043", "2341:0243"],
10-
"emulator": "simavr -m atmega328p -f 16000000 {}"
2+
"inherits": ["arduino-uno"]
113
}

0 commit comments

Comments
 (0)