Kaynağa Gözat

added upload commands to the Makefile

Andrew Tridgell 3 yıl önce
ebeveyn
işleme
5d57814daa
2 değiştirilmiş dosya ile 15 ekleme ve 9 silme
  1. 0 1
      .github/workflows/test_build.yml
  2. 15 8
      RemoteIDModule/Makefile

+ 0 - 1
.github/workflows/test_build.yml

@@ -19,7 +19,6 @@ jobs:
         run: |
           PATH="$HOME/.local/bin:$PATH"
           ./scripts/install_build_env.sh
-          ./scripts/regen_headers.sh
           ./scripts/add_libraries.sh
 
       - name: Build

+ 15 - 8
RemoteIDModule/Makefile

@@ -5,14 +5,16 @@ ESP32_VER=2.0.3
 ESP32_TOOLS=$(ARDUINO_HOME)/packages/esp32/hardware/esp32/$(ESP32_VER)/tools
 ESPTOOL=$(ESP32_TOOLS)/esptool.py
 
-#CHIP=esp32s3
-#BOARD=ESP32S3_DEV
-
 ESP32_FQBN=esp32:esp32:$(CHIP)
 SERDEV := $(wildcard /dev/serial/by-id/usb-Espressif_*)
 ARDUINO_CLI=../bin/arduino-cli
 
-all: esp32s3dev bluemark-db200 bluemark-db110
+# ensure python tools are in $PATH
+export PATH := $(HOME)/.local/bin:$(PATH)
+
+.PHONY: headers
+
+all: headers esp32s3dev bluemark-db200 bluemark-db110
 
 esp32s3dev: CHIP=esp32s3
 esp32s3dev: ArduRemoteID-ESP32S3_DEV.bin
@@ -28,10 +30,13 @@ setup:
 	$(ARDUINO_CLI) core update-index --config-file arduino-cli.yaml
 	$(ARDUINO_CLI) core install esp32:esp32@$(ESP32_VER)
 
+headers:
+	@../scripts/git-version.sh
+	@cd .. && scripts/regen_headers.sh
+
 ArduRemoteID-%.bin: *.cpp *.ino *.h
 	@echo "Building $* on $(CHIP)"
 	@BUILD_FLAGS="-DBOARD_$*"
-	@../scripts/git-version.sh
 	@rm -rf build
 	@$(ARDUINO_CLI) compile -b esp32:esp32:$(CHIP) --export-binaries --build-property build.extra_flags=-DBOARD_$* .
 	@echo "Merging $*"
@@ -45,9 +50,11 @@ boards:
 checkdev:
 	@[ "${SERDEV}" ] && echo "Using device $(SERDEV)" || ( echo "Failed to find serial device"; exit 1 )
 
-upload: checkdev
-	@echo "Flashing ArduRemoteID-ESP32S3_DEV.bin"
-	@$(ARDUINO_CLI) upload -p $(SERDEV) --fqbn $(ESP32_FQBN) .
+upload-%: checkdev
+	@echo "Flashing ArduRemoteID-$*.bin"
+	$(ESPTOOL) --port $(SERDEV) write_flash 0x0 ArduRemoteID-$*.bin
+
+upload: upload-ESP32S3_DEV
 
 clean:
 	rm -rf ..esp32* *.bin build*