summaryrefslogtreecommitdiff
path: root/Makefile
blob: ccfe14a8d71111d90d878fa780c2caac59390a58 (plain)
  1. PROJECT = src.ino
  2. SOURCE_DIR = src
  3. BUILD_DIR = $(CURDIR)/.build
  4. OPTS_HARDWARE = -hardware /usr/share/arduino/hardware -hardware ~/.arduino15/packages
  5. OPTS_TOOLS = -tools /usr/share/arduino/hardware/tools/avr -tools ~/.arduino15/packages
  6. OPTS_LIBS = -libraries ~/Arduino/libraries
  7. #FQBN = -fqbn=esp32:esp32:esp32:JTAGAdapter=default,PSRAM=disabled,PartitionScheme=default,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,LoopCore=1,EventsCore=1,DebugLevel=none,EraseFlash=none
  8. FQBN = -fqbn=esp32:esp32:esp32
  9. all: build upload
  10. build:
  11. mkdir --parents .build .cache
  12. arduino-builder -compile -logger=machine \
  13. $(OPTS_HARDWARE) $(OPTS_TOOLS) $(OPTS_LIBS) $(FQBN) \
  14. -ide-version=10819 -build-path $(BUILD_DIR) -warnings=none -build-cache ~/.cache \
  15. -verbose \
  16. $(SOURCE_DIR)/$(PROJECT)
  17. clean:
  18. rm -rf .build
  19. distclean: clean
  20. rm -rf .cache
  21. .NOTPARALLEL:
  22. upload:
  23. python3 ~/.arduino15/packages/esp32/tools/esptool_py/4.5.1/esptool.py \
  24. --chip esp32 --port /dev/ttyUSB0 --baud 921600 \
  25. --before default_reset --after hard_reset write_flash \
  26. -z --flash_mode dio --flash_freq 80m --flash_size 4MB \
  27. 0x1000 .build/$(PROJECT).bootloader.bin \
  28. 0x8000 .build/$(PROJECT).partitions.bin \
  29. 0xe000 ~/.arduino15/packages/esp32/hardware/esp32/2.0.14/tools/partitions/boot_app0.bin \
  30. 0x10000 .build/$(PROJECT).bin