Skip to content

Commit 0b771a0

Browse files
committed
make example
1 parent c58f7ba commit 0b771a0

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

examples/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
DEST := $(if $(DEST),$(DEST),gate)
3+
BOARD := "esp8266:esp8266:generic:FlashSize=2M"
4+
5+
6+
LOCAL_C_SRCS ?= $(wildcard *.c)
7+
LOCAL_INO_SRCS ?= $(wildcard *.ino)
8+
LOCAL_SRCS = $(LOCAL_C_SRCS) $(LOCAL_INO_SRCS)
9+
10+
all: compile
11+
12+
compile:
13+
docker run -ti -v $$(pwd):/build damonpetta/arduino-cli-esp8266 compile -b $(BOARD) $(LOCAL_SRCS) -o $(DEST).bin
14+
15+
usb:
16+
esptool.py -p /dev/ttyUSB0 --baud 115200 \
17+
write_flash --flash_mode dout 0x0000 $(DEST).bin
18+
19+
curl:
20+
curl -v -F "image=@$(DEST).bin" $(DEST)/update
21+
22+
clean:
23+
rm *.bin *.elf

examples/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
### Examples
3+
4+
* Makefile - example Makefile to call docker image to build

0 commit comments

Comments
 (0)