Lift duplication of command to a var

pull/931/head
Jesse Vincent 4 years ago
parent 6bc8c4e243
commit 1865e33426
No known key found for this signature in database
GPG Key ID: CC228463465E40BC

@ -259,26 +259,21 @@ check_bootloader_port_and_flash () {
}
flash_over_usb () {
if [ "${ARDUINO_VERBOSE}" != "-verbose" ]; then
${AVRDUDE} \
FLASH_CMD=${AVRDUDE} \
-C "${AVRDUDE_CONF}" \
-p"${MCU}" \
-cavr109 \
-D \
-P "${DEVICE_PORT_BOOTLOADER}" \
-b57600 \
"-Uflash:w:${HEX_FILE_PATH}:i" \
2>&1 |grep -v ^avrdude | grep -v '^$' |grep -v '^ ' | grep -vi programmer
"-Uflash:w:${HEX_FILE_PATH}:i"
if [ "${ARDUINO_VERBOSE}" != "-verbose" ]; then
${FLASH_CMD} 2>&1 |grep -v ^avrdude | grep -v '^$' |grep -v '^ ' | grep -vi programmer
return "${PIPESTATUS[0]}"
else
${AVRDUDE} \
-C "${AVRDUDE_CONF}" \
-p"${MCU}" \
-cavr109 \
-D \
-P "${DEVICE_PORT_BOOTLOADER}" \
-b57600 \
"-Uflash:w:${HEX_FILE_PATH}:i"
${FLASH_CMD}
return $?
fi
}

Loading…
Cancel
Save