summaryrefslogtreecommitdiff
path: root/ports/esp8266
diff options
context:
space:
mode:
authorLars Kellogg-Stedman <lars@oddbit.com>2018-05-02 09:34:21 -0400
committerLars Kellogg-Stedman <lars@oddbit.com>2018-05-02 09:47:01 -0400
commit3e35cbcd5b3e15afae268f9dedb1e285124e61d9 (patch)
treec6b2b7256d0311cba4dfb3bcccbcc9553b8cc366 /ports/esp8266
parentdd0f8689a135b33dbeedaefdfa149fd7ec3c94e8 (diff)
allow esptool.py invocation to be set via make vars
This commit replaces the literal calls to `esptool.py` with the `$(ESPTOOL)` Makefile variable. This allows one to set the esptool invocation on the Make command line: make ESPTOOL="python2 $(which esptool.py)" (or via the environment, an include file, etc) Closes #793
Diffstat (limited to 'ports/esp8266')
-rw-r--r--ports/esp8266/Makefile7
1 files changed, 4 insertions, 3 deletions
diff --git a/ports/esp8266/Makefile b/ports/esp8266/Makefile
index 06439a19e..8fabd3412 100644
--- a/ports/esp8266/Makefile
+++ b/ports/esp8266/Makefile
@@ -32,6 +32,7 @@ FLASH_MODE ?= qio
FLASH_SIZE ?= detect
CROSS_COMPILE = xtensa-lx106-elf-
ESP_SDK = $(shell $(CC) -print-sysroot)/usr
+ESPTOOL = esptool.py
INC += -I.
INC += -I$(TOP)
@@ -230,18 +231,18 @@ FROZEN_EXTRA_DEPS = $(CONFVARS_FILE)
deploy: $(BUILD)/firmware-combined.bin
$(ECHO) "Writing $< to the board"
- $(Q)esptool.py --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=$(FLASH_SIZE) --flash_mode=$(FLASH_MODE) 0 $<
+ $(Q)$(ESPTOOL) --port $(PORT) --baud $(BAUD) write_flash --verify --flash_size=$(FLASH_SIZE) --flash_mode=$(FLASH_MODE) 0 $<
erase:
$(ECHO) "Erase flash"
- $(Q)esptool.py --port $(PORT) --baud $(BAUD) erase_flash
+ $(Q)$(ESPTOOL) --port $(PORT) --baud $(BAUD) erase_flash
reset:
echo -e "\r\nimport machine; machine.reset()\r\n" >$(PORT)
$(FWBIN): $(BUILD)/firmware.elf
$(ECHO) "Create $@"
- $(Q)python2 $(shell which esptool.py) elf2image $^
+ $(Q)$(ESPTOOL) elf2image $^
$(Q)$(PYTHON) makeimg.py $(BUILD)/firmware.elf-0x00000.bin $(BUILD)/firmware.elf-0x[0-5][1-f]000.bin $@