|
|
@ -205,21 +205,18 @@ firmware_size () {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
find_sketch () {
|
|
|
|
find_sketch () {
|
|
|
|
if [ -z "${SKETCH}" ]; then
|
|
|
|
SKETCH_DIR="${SKETCH:-$(absolute_filename $(pwd))}"
|
|
|
|
echo "SKETCH needs to be set before including this file!" >&2
|
|
|
|
SKETCH_BASE_NAME=$(basename "${SKETCH_DIR}")
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SKETCH_DIR="${SKETCH}"
|
|
|
|
|
|
|
|
SKETCH_BASE_NAME=$(basename "$SKETCH")
|
|
|
|
|
|
|
|
SKETCH_FILE_NAME="${SKETCH_BASE_NAME}.ino"
|
|
|
|
SKETCH_FILE_NAME="${SKETCH_BASE_NAME}.ino"
|
|
|
|
|
|
|
|
|
|
|
|
for path in "${SKETCH_DIR}" \
|
|
|
|
# Arduino sketches are usually a file inside directory Foo named Foo.ino, so try that as a fallback
|
|
|
|
"src" \
|
|
|
|
for dir in \
|
|
|
|
|
|
|
|
"${SKETCH_DIR}" \
|
|
|
|
|
|
|
|
"src/" \
|
|
|
|
"."; do
|
|
|
|
"."; do
|
|
|
|
if [ -f "${path}/${SKETCH_FILE_NAME}" ]; then
|
|
|
|
if [ -f "${dir}/${SKETCH_FILE_NAME}" ]; then
|
|
|
|
SKETCH_DIR="${path}"
|
|
|
|
SKETCH_DIR="${dir}"
|
|
|
|
SKETCH_FILE_PATH=$(absolute_filename "${SKETCH_DIR}/${SKETCH_FILE_NAME}")
|
|
|
|
SKETCH_FILE_PATH=$(absolute_filename "${dir}/${SKETCH_FILE_NAME}")
|
|
|
|
return
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|