2023-01-03 00:24:27 +08:00
|
|
|
SDK_VERSION ?= 1.4.0
|
|
|
|
SDK_REPO ?= https://github.com/raspberrypi/pico-sdk
|
2023-01-30 06:39:01 +08:00
|
|
|
MBEDTLS_VERSION ?= v2.27.0
|
|
|
|
MBEDTLS_REPO ?= https://github.com/Mbed-TLS/mbedtls
|
2023-01-03 00:24:27 +08:00
|
|
|
|
2023-01-30 06:39:01 +08:00
|
|
|
all example build build/firmware.uf2: pico-sdk mbedtls main.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-30 06:39:01 +08:00
|
|
|
mbedtls:
|
|
|
|
git clone --depth 1 -b $(MBEDTLS_VERSION) $(MBEDTLS_REPO) $@
|
|
|
|
|
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-01-30 06:39:01 +08:00
|
|
|
rm -rf pico-sdk mbedtls build
|