2023-02-14 23:03:52 +08:00
|
|
|
SDK_VERSION ?= 1.5.0
|
2023-01-03 00:24:27 +08:00
|
|
|
SDK_REPO ?= https://github.com/raspberrypi/pico-sdk
|
|
|
|
|
2023-02-14 23:03:52 +08:00
|
|
|
all example build build/firmware.uf2: pico-sdk main.c net.c packed_fs.c
|
2023-01-03 00:24:27 +08:00
|
|
|
test -d build || mkdir build
|
|
|
|
cd build && cmake .. && make
|
|
|
|
|
|
|
|
pico-sdk:
|
|
|
|
git clone --depth 1 -b $(SDK_VERSION) $(SDK_REPO) $@
|
|
|
|
cd $@ && git submodule update --init
|
|
|
|
|
2023-01-21 09:36:25 +08:00
|
|
|
# Requires env variable VCON_API_KEY set
|
|
|
|
DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/3
|
|
|
|
test: update
|
|
|
|
curl --fail -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
|
|
|
grep 'Ethernet: up' /tmp/output.txt
|
|
|
|
grep 'MQTT connected' /tmp/output.txt
|
|
|
|
|
|
|
|
update: build/firmware.uf2
|
|
|
|
curl --fail -su :$(VCON_API_KEY) $(DEVICE_URL)/ota?uf2=1 --data-binary @$<
|
|
|
|
|
2023-01-03 00:24:27 +08:00
|
|
|
clean:
|
2023-02-14 23:03:52 +08:00
|
|
|
rm -rf pico-sdk build
|