Skip to content

Commit 17e6294

Browse files
committed
Minor fixes needed for newer Arduino IDE versions
1 parent 35f6e42 commit 17e6294

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

makeEspArduino.mk

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ ifndef ESP_ROOT
9494
ifeq ($(ESP_ROOT),)
9595
$(error No installed version of $(CHIP) Arduino found)
9696
endif
97-
ARDUINO_LIBS ?= $(shell grep -o "sketchbook.path=.*" $(ARDUINO_ROOT)/preferences.txt 2>/dev/null | cut -f2- -d=)/libraries
97+
ARDUINO_PREFS = $(wildcard $(ARDUINO_ROOT)/preferences.txt)
98+
ifeq ($(ARDUINO_PREFS),)
99+
ARDUINO_LIBS ?= $(ARDUINO_ROOT)/libraries $(HOME)/Arduino/libraries
100+
else
101+
ARDUINO_LIBS ?= $(shell grep -o "sketchbook.path=.*" $(ARDUINO_PREFS) 2>/dev/null | cut -f2- -d=)/libraries
102+
endif
98103
ESP_ARDUINO_VERSION := $(notdir $(ESP_ROOT))
99104
# Find used version of compiler and tools
100105
COMP_PATH := $(lastword $(wildcard $(ARDUINO_ESP_ROOT)/tools/xtensa-*/*))
@@ -137,7 +142,9 @@ endif
137142

138143
# Handle esptool variants
139144
MCU ?= $(CHIP)
140-
ESPTOOL_FILE = $(firstword $(wildcard $(ESP_ROOT)/tools/esptool/esptool.py) $(ESP_ROOT)/tools/esptool/esptool )
145+
ESPTOOL_FILE = $(firstword $(wildcard $(ESP_ROOT)/tools/esptool/esptool.py) \
146+
$(wildcard $(ARDUINO_ESP_ROOT)/tools/esptool_py/*/esptool.py) \
147+
$(ESP_ROOT)/tools/esptool/esptool)
141148
ESPTOOL ?= $(if $(NO_PY_WRAP),$(ESPTOOL_FILE),$(PY_WRAP) esptool)
142149
ESPTOOL_COM ?= $(ESPTOOL) --baud=$(UPLOAD_SPEED) --port $(UPLOAD_PORT) --chip $(MCU)
143150
ifeq ($(IS_ESP32),)

0 commit comments

Comments
 (0)