@@ -18,7 +18,7 @@ if [ ! -f $CH_HOME/make/cpphash.mk ]; then
18
18
fi
19
19
20
20
if [[ "$CH_BUILD" == "" ]]; then
21
- CH_BUILD="build"
21
+ export CH_BUILD="build"
22
22
fi
23
23
24
24
if [[ "$ESPMAKE_PREFIX" == "" ]]; then
84
84
# of the last project built. Example: $ESPMAKE_PRJ_HOME/build/espinit
85
85
86
86
_ESPMAKE_LAST_BUILD() {
87
- echo "${ESPMAKE_PRJ_HOME}/$( CH_BUILD) /$(basename $(dirname $(cat $ESPMAKE_PRJ_LAST)))_$(basename $(cat $ESPMAKE_PRJ_LAST) .mk)"
87
+ echo "${ESPMAKE_PRJ_HOME}/$CH_BUILD/$(basename $(dirname $(cat $ESPMAKE_PRJ_LAST)))_$(basename $(cat $ESPMAKE_PRJ_LAST) .mk)"
88
88
}
89
89
90
90
# Helper function that returns the name of the esphome device as
@@ -103,12 +103,12 @@ alias _ESPMAKE_USB='function _ESPMAKE_USB { _VERB=${1}; _DEV=${2}; cd $(_ESPMAKE
103
103
# Helper alias to upload last project using OTA update to IP _ESPMAKE_IP<arg>
104
104
# Note the indirect variable reference ${!_IP} to choose the _IP
105
105
106
- alias _ESPMAKE_UPLOAD='function _ESPMAKE_UPLOAD { _IPNUM=${1}; _IP=_ESPMAKE_IP${_IPNUM}; esphome -v upload --device ${!_IP} --file $(_ESPMAKE_LAST_BUILD)/.esphome/$( CH_BUILD) /$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME)/firmware.bin $(_ESPMAKE_LAST_BUILD)/espmake.yaml;}; _ESPMAKE_UPLOAD'
106
+ alias _ESPMAKE_UPLOAD='function _ESPMAKE_UPLOAD { _IPNUM=${1}; _IP=_ESPMAKE_IP${_IPNUM}; esphome -v upload --device ${!_IP} --file $(_ESPMAKE_LAST_BUILD)/.esphome/$CH_BUILD/$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME)/firmware.bin $(_ESPMAKE_LAST_BUILD)/espmake.yaml;}; _ESPMAKE_UPLOAD'
107
107
108
108
# _ESPMAKE_IDF_JTAG uses esp-idf directly to burn firmware to /dev/ttyACM0
109
109
110
110
export ESPTOOL_TESTING=1 # as per esptool/esp32s2.py
111
- alias _ESPMAKE_IDF_JTAG='(cd $(_ESPMAKE_LAST_BUILD)/.esphome/$( CH_BUILD) /$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME) && esptool.py --before default_reset --after no_reset --baud 1500000 --port $_ESPMAKE_DEV0 --chip esp32s2 write_flash -z --flash_size detect 0x10000 firmware.bin 0x1000 bootloader.bin 0x8000 partitions.bin 0x9000 ota_data_initial.bin)'
111
+ alias _ESPMAKE_IDF_JTAG='(cd $(_ESPMAKE_LAST_BUILD)/.esphome/$CH_BUILD/$(_ESPMAKE_LAST_ESPNAME)/.pioenvs/$(_ESPMAKE_LAST_ESPNAME) && esptool.py --before default_reset --after no_reset --baud 1500000 --port $_ESPMAKE_DEV0 --chip esp32s2 write_flash -z --flash_size detect 0x10000 firmware.bin 0x1000 bootloader.bin 0x8000 partitions.bin 0x9000 ota_data_initial.bin)'
112
112
113
113
# Convenience aliases
114
114
@@ -157,7 +157,7 @@ alias ${ESPMAKE_PREFIX}esphome='view $(_ESPMAKE_LAST_BUILD)/esphome.yaml'
157
157
# Aliases to find strings including or excluding the build directory
158
158
159
159
alias ${ESPMAKE_PREFIX}search="find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' -type f -print0 | xargs -0 grep -i"
160
- alias ${ESPMAKE_PREFIX}search_home="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path ' */$( CH_BUILD)/*' ! -path '* /cpphash/*' -type f -print0 | xargs -0 grep -i"
160
+ alias ${ESPMAKE_PREFIX}search_home="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path " */$CH_BUILD/*" ! -path '. /cpphash/*' -type f -print0 | xargs -0 grep -i"
161
161
alias ${ESPMAKE_PREFIX}search_all="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' -type f -print0 | xargs -0 grep -i"
162
162
163
163
# Aliases to search for arg1 and replace it with arg2 in all files.
@@ -166,13 +166,13 @@ alias ${ESPMAKE_PREFIX}search_all="find $ESPMAKE_PRJ_HOME ! -name '*.swp' ! -nam
166
166
# bash does not seem to allow these to be defined with ESPMAKE_PREFIX.
167
167
168
168
esp_replace_nohash() {
169
- find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path ' */$( CH_BUILD)/*' ! -path '* /cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s#$1#$2#g"
169
+ find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path " */$CH_BUILD/*" ! -path '. /cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s#$1#$2#g"
170
170
}
171
171
esp_replace_nocomma() {
172
- find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path ' */$( CH_BUILD)/*' ! -path '* /cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s,$1,$2,g"
172
+ find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path " */$CH_BUILD/*" ! -path '. /cpphash/*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s,$1,$2,g"
173
173
}
174
174
esp_replace_noslash() {
175
- find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path ' */$( CH_BUILD)/*' ! -path '* /cpphash*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s/$1/$2/g"
175
+ find . ! -name '*.swp' ! -name '*.bak' ! -path '*/.git/*' ! -path " */$CH_BUILD/*" ! -path '. /cpphash*' ! -path '*/.esphome/*' -type f -print0 | xargs -0 grep -l "$1" | xargs $SED --in-place=.bak "s/$1/$2/g"
176
176
}
177
177
alias esp_replace="esp_replace_noslash"
178
178
0 commit comments