Add option to build.sh to enable debug in ESP-IDF (#151)

* Add option to build.sh to enable debug in ESP-IDF

* Make PR  title use the info from versions.txt

* Copy dependencies.lock for each target
This commit is contained in:
Me No Dev 2023-11-23 17:39:07 +02:00 committed by GitHub
parent 9234dd97db
commit e86b30a9a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 74 additions and 144 deletions

View file

@ -12,6 +12,7 @@ fi
TARGET="all" TARGET="all"
BUILD_TYPE="all" BUILD_TYPE="all"
BUILD_DEBUG="default"
SKIP_ENV=0 SKIP_ENV=0
COPY_OUT=0 COPY_OUT=0
ARCHIVE_OUT=0 ARCHIVE_OUT=0
@ -20,13 +21,14 @@ if [ -z $DEPLOY_OUT ]; then
fi fi
function print_help() { function print_help() {
echo "Usage: build.sh [-s] [-A <arduino_branch>] [-I <idf_branch>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf_libs|copy_bootloader|mem_variant>] [config ...]" echo "Usage: build.sh [-s] [-A <arduino_branch>] [-I <idf_branch>] [-D <debug_level>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf_libs|copy_bootloader|mem_variant>] [config ...]"
echo " -s Skip installing/updating of ESP-IDF and all components" echo " -s Skip installing/updating of ESP-IDF and all components"
echo " -A Set which branch of arduino-esp32 to be used for compilation" echo " -A Set which branch of arduino-esp32 to be used for compilation"
echo " -I Set which branch of ESP-IDF to be used for compilation" echo " -I Set which branch of ESP-IDF to be used for compilation"
echo " -i Set which commit of ESP-IDF to be used for compilation" echo " -i Set which commit of ESP-IDF to be used for compilation"
echo " -e Archive the build to dist" echo " -e Archive the build to dist"
echo " -d Deploy the build to github arduino-esp32" echo " -d Deploy the build to github arduino-esp32"
echo " -D Debug level to be set to ESP-IDF. One of default,none,error,warning,info,debug or verbose"
echo " -c Set the arduino-esp32 folder to copy the result to. ex. '$HOME/Arduino/hardware/espressif/esp32'" echo " -c Set the arduino-esp32 folder to copy the result to. ex. '$HOME/Arduino/hardware/espressif/esp32'"
echo " -t Set the build target(chip). ex. 'esp32s3'" echo " -t Set the build target(chip). ex. 'esp32s3'"
echo " -b Set the build type. ex. 'build' to build the project and prepare for uploading to a board" echo " -b Set the build type. ex. 'build' to build the project and prepare for uploading to a board"
@ -34,7 +36,7 @@ function print_help() {
exit 1 exit 1
} }
while getopts ":A:I:i:c:t:b:sde" opt; do while getopts ":A:I:i:c:t:b:D:sde" opt; do
case ${opt} in case ${opt} in
s ) s )
SKIP_ENV=1 SKIP_ENV=1
@ -58,6 +60,9 @@ while getopts ":A:I:i:c:t:b:sde" opt; do
i ) i )
export IDF_COMMIT="$OPTARG" export IDF_COMMIT="$OPTARG"
;; ;;
D )
BUILD_DEBUG="$OPTARG"
;;
t ) t )
TARGET=$OPTARG TARGET=$OPTARG
;; ;;
@ -107,8 +112,8 @@ else
source ./tools/config.sh source ./tools/config.sh
fi fi
if [ -f "./managed_components/espressif__esp-sr/.component_hash" ]; then if [ -f "$AR_MANAGED_COMPS/espressif__esp-sr/.component_hash" ]; then
rm -rf ./managed_components/espressif__esp-sr/.component_hash rm -rf $AR_MANAGED_COMPS/espressif__esp-sr/.component_hash
fi fi
if [ "$BUILD_TYPE" != "all" ]; then if [ "$BUILD_TYPE" != "all" ]; then
@ -116,7 +121,7 @@ if [ "$BUILD_TYPE" != "all" ]; then
echo "ERROR: You need to specify target for non-default builds" echo "ERROR: You need to specify target for non-default builds"
print_help print_help
fi fi
configs="configs/defconfig.common;configs/defconfig.$TARGET" configs="configs/defconfig.common;configs/defconfig.$TARGET;configs/defconfig.debug_$BUILD_DEBUG"
# Target Features Configs # Target Features Configs
for target_json in `jq -c '.targets[]' configs/builds.json`; do for target_json in `jq -c '.targets[]' configs/builds.json`; do
@ -141,19 +146,7 @@ if [ "$BUILD_TYPE" != "all" ]; then
fi fi
rm -rf build sdkconfig out rm -rf build sdkconfig out
mkdir -p "$AR_TOOLS/esp32-arduino-libs"
# Add components version info
mkdir -p "$AR_TOOLS/esp32-arduino-libs" && rm -rf version.txt && rm -rf "$AR_TOOLS/esp32-arduino-libs/versions.txt"
component_version="esp-idf: "$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)" "$(git -C "$IDF_PATH" rev-parse --short HEAD)
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
for component in `ls "$AR_COMPS"`; do
if [ -d "$AR_COMPS/$component/.git" ] || [ -d "$AR_COMPS/$component/.github" ]; then
component_version="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
fi
done
component_version="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD || git -C "$AR_COMPS/arduino_tinyusb/tinyusb" tag --points-at HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)
echo $component_version >> version.txt && echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
#targets_count=`jq -c '.targets[] | length' configs/builds.json` #targets_count=`jq -c '.targets[] | length' configs/builds.json`
for target_json in `jq -c '.targets[]' configs/builds.json`; do for target_json in `jq -c '.targets[]' configs/builds.json`; do
@ -175,7 +168,7 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
echo "* Target: $target" echo "* Target: $target"
# Build Main Configs List # Build Main Configs List
main_configs="configs/defconfig.common;configs/defconfig.$target" main_configs="configs/defconfig.common;configs/defconfig.$target;configs/defconfig.debug_$BUILD_DEBUG"
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
main_configs="$main_configs;configs/defconfig.$defconf" main_configs="$main_configs;configs/defconfig.$defconf"
done done
@ -186,8 +179,8 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
idf_libs_configs="$idf_libs_configs;configs/defconfig.$defconf" idf_libs_configs="$idf_libs_configs;configs/defconfig.$defconf"
done done
if [ -f "./managed_components/espressif__esp-sr/.component_hash" ]; then if [ -f "$AR_MANAGED_COMPS/espressif__esp-sr/.component_hash" ]; then
rm -rf ./managed_components/espressif__esp-sr/.component_hash rm -rf $AR_MANAGED_COMPS/espressif__esp-sr/.component_hash
fi fi
echo "* Build IDF-Libs: $idf_libs_configs" echo "* Build IDF-Libs: $idf_libs_configs"
@ -215,8 +208,8 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
bootloader_configs="$bootloader_configs;configs/defconfig.$defconf"; bootloader_configs="$bootloader_configs;configs/defconfig.$defconf";
done done
if [ -f "./managed_components/espressif__esp-sr/.component_hash" ]; then if [ -f "$AR_MANAGED_COMPS/espressif__esp-sr/.component_hash" ]; then
rm -rf ./managed_components/espressif__esp-sr/.component_hash rm -rf $AR_MANAGED_COMPS/espressif__esp-sr/.component_hash
fi fi
echo "* Build BootLoader: $bootloader_configs" echo "* Build BootLoader: $bootloader_configs"
@ -232,8 +225,8 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
mem_configs="$mem_configs;configs/defconfig.$defconf"; mem_configs="$mem_configs;configs/defconfig.$defconf";
done done
if [ -f "./managed_components/espressif__esp-sr/.component_hash" ]; then if [ -f "$AR_MANAGED_COMPS/espressif__esp-sr/.component_hash" ]; then
rm -rf ./managed_components/espressif__esp-sr/.component_hash rm -rf $AR_MANAGED_COMPS/espressif__esp-sr/.component_hash
fi fi
echo "* Build Memory Variant: $mem_configs" echo "* Build Memory Variant: $mem_configs"
@ -243,6 +236,37 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
done done
done done
#
# Add components version info
#
rm -rf "$AR_TOOLS/esp32-arduino-libs/versions.txt"
# The lib-builder version
component_version="lib-builder: "$(git -C "$AR_ROOT" symbolic-ref --short HEAD || git -C "$AR_ROOT" tag --points-at HEAD)" "$(git -C "$AR_ROOT" rev-parse --short HEAD)
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
# ESP-IDF version
component_version="esp-idf: "$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)" "$(git -C "$IDF_PATH" rev-parse --short HEAD)
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
# components version
for component in `ls "$AR_COMPS"`; do
if [ -d "$AR_COMPS/$component/.git" ]; then
component_version="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
fi
done
# TinyUSB version
component_version="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD || git -C "$AR_COMPS/arduino_tinyusb/tinyusb" tag --points-at HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
# managed components version
for component in `ls "$AR_MANAGED_COMPS"`; do
if [ -d "$AR_MANAGED_COMPS/$component/.git" ]; then
component_version="$component: "$(git -C "$AR_MANAGED_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_MANAGED_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_MANAGED_COMPS/$component" rev-parse --short HEAD)
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
elif [ -f "$AR_MANAGED_COMPS/$component/idf_component.yml" ]; then
component_version="$component: "$(cat "$AR_MANAGED_COMPS/$component/idf_component.yml" | grep "^version: " | cut -d ' ' -f 2)
echo $component_version >> "$AR_TOOLS/esp32-arduino-libs/versions.txt"
fi
done
# update package_esp32_index.template.json # update package_esp32_index.template.json
if [ "$BUILD_TYPE" = "all" ]; then if [ "$BUILD_TYPE" = "all" ]; then
python3 ./tools/gen_tools_json.py -i "$IDF_PATH" -j "$AR_COMPS/arduino/package/package_esp32_index.template.json" -o "$AR_OUT/" python3 ./tools/gen_tools_json.py -i "$IDF_PATH" -j "$AR_COMPS/arduino/package/package_esp32_index.template.json" -o "$AR_OUT/"

View file

@ -1,7 +1,6 @@
CONFIG_AUTOSTART_ARDUINO=y CONFIG_AUTOSTART_ARDUINO=y
# CONFIG_WS2812_LED_ENABLE is not set # CONFIG_WS2812_LED_ENABLE is not set
CONFIG_ARDUHAL_ESP_LOG=y CONFIG_ARDUHAL_ESP_LOG=y
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE=y
CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP=y
CONFIG_BT_ENABLED=y CONFIG_BT_ENABLED=y
@ -46,7 +45,6 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1024
CONFIG_HEAP_POISONING_LIGHT=y CONFIG_HEAP_POISONING_LIGHT=y
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024
CONFIG_HTTPD_WS_SUPPORT=y CONFIG_HTTPD_WS_SUPPORT=y
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y
# CONFIG_LOG_COLORS is not set # CONFIG_LOG_COLORS is not set
CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y
# CONFIG_LWIP_DHCP_DOES_ARP_CHECK is not set # CONFIG_LWIP_DHCP_DOES_ARP_CHECK is not set

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_ERROR=y
CONFIG_LOG_DEFAULT_LEVEL_ERROR=y

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL_INFO=y

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_NONE=y
CONFIG_LOG_DEFAULT_LEVEL_NONE=y

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y

View file

@ -0,0 +1,2 @@
CONFIG_BOOTLOADER_LOG_LEVEL_WARN=y
CONFIG_LOG_DEFAULT_LEVEL_WARN=y

View file

@ -42,6 +42,7 @@ fi
AR_ROOT="$PWD" AR_ROOT="$PWD"
AR_COMPS="$AR_ROOT/components" AR_COMPS="$AR_ROOT/components"
AR_MANAGED_COMPS="$AR_ROOT/managed_components"
AR_OUT="$AR_ROOT/out" AR_OUT="$AR_ROOT/out"
AR_TOOLS="$AR_OUT/tools" AR_TOOLS="$AR_OUT/tools"
AR_PLATFORM_TXT="$AR_OUT/platform.txt" AR_PLATFORM_TXT="$AR_OUT/platform.txt"
@ -152,15 +153,7 @@ function git_create_pr(){ # git_create_pr <branch> <title>
local pr_title="$2" local pr_title="$2"
local pr_target="$3" local pr_target="$3"
local pr_body="" local pr_body=""
pr_body+="esp-idf: "$(git -C "$IDF_PATH" symbolic-ref --short HEAD || git -C "$IDF_PATH" tag --points-at HEAD)" "$(git -C "$IDF_PATH" rev-parse --short HEAD)"\r\n" pr_body+=$(cat "$AR_TOOLS/esp32-arduino-libs/versions.txt")"\r\n"
for component in `ls "$AR_COMPS"`; do
if [ ! $component == "arduino" ]; then
if [ -d "$AR_COMPS/$component/.git" ] || [ -d "$AR_COMPS/$component/.github" ]; then
pr_body+="$component: "$(git -C "$AR_COMPS/$component" symbolic-ref --short HEAD || git -C "$AR_COMPS/$component" tag --points-at HEAD)" "$(git -C "$AR_COMPS/$component" rev-parse --short HEAD)"\r\n"
fi
fi
done
pr_body+="tinyusb: "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" symbolic-ref --short HEAD || git -C "$AR_COMPS/arduino_tinyusb/tinyusb" tag --points-at HEAD)" "$(git -C "$AR_COMPS/arduino_tinyusb/tinyusb" rev-parse --short HEAD)"\r\n"
local pr_data="{\"title\": \"$pr_title\", \"body\": \"$pr_body\", \"head\": \"$AR_USER:$pr_branch\", \"base\": \"$pr_target\"}" local pr_data="{\"title\": \"$pr_title\", \"body\": \"$pr_body\", \"head\": \"$AR_USER:$pr_branch\", \"base\": \"$pr_target\"}"
git_create_pr_res=`echo "$pr_data" | curl -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" --data @- "https://api.github.com/repos/$AR_REPO/pulls"` git_create_pr_res=`echo "$pr_data" | curl -k -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3.raw+json" --data @- "https://api.github.com/repos/$AR_REPO/pulls"`
local done_pr=`echo "$git_create_pr_res" | jq -r '.title'` local done_pr=`echo "$git_create_pr_res" | jq -r '.title'`

View file

@ -490,6 +490,9 @@ fi
# sdkconfig # sdkconfig
cp -f "sdkconfig" "$AR_SDK/sdkconfig" cp -f "sdkconfig" "$AR_SDK/sdkconfig"
# dependencies.lock
cp -f "dependencies.lock" "$AR_SDK/dependencies.lock"
# gen_esp32part.py # gen_esp32part.py
# cp "$IDF_PATH/components/partition_table/gen_esp32part.py" "$AR_GEN_PART_PY" # cp "$IDF_PATH/components/partition_table/gen_esp32part.py" "$AR_GEN_PART_PY"

View file

@ -2,118 +2,16 @@
source ./tools/config.sh source ./tools/config.sh
CAMERA_REPO_URL="https://github.com/espressif/esp32-camera.git"
DL_REPO_URL="https://github.com/espressif/esp-dl.git"
SR_REPO_URL="https://github.com/espressif/esp-sr.git"
RMAKER_REPO_URL="https://github.com/espressif/esp-rainmaker.git"
LITTLEFS_REPO_URL="https://github.com/joltwallet/esp_littlefs.git"
TINYUSB_REPO_URL="https://github.com/hathach/tinyusb.git"
TFLITE_REPO_URL="https://github.com/espressif/tflite-micro-esp-examples.git"
#
# CLONE/UPDATE ESP32-CAMERA
#
#echo "Updating ESP32 Camera..."
#if [ ! -d "$AR_COMPS/esp32-camera" ]; then
# git clone $CAMERA_REPO_URL "$AR_COMPS/esp32-camera"
#else
# git -C "$AR_COMPS/esp32-camera" fetch && \
# git -C "$AR_COMPS/esp32-camera" pull --ff-only
#fi
#if [ $? -ne 0 ]; then exit 1; fi
#
# CLONE/UPDATE ESP-DL
#
#echo "Updating ESP-DL..."
#if [ ! -d "$AR_COMPS/esp-dl" ]; then
# git clone $DL_REPO_URL "$AR_COMPS/esp-dl"
#this is a temp measure to fix build issue
# mv "$AR_COMPS/esp-dl/CMakeLists.txt" "$AR_COMPS/esp-dl/CMakeListsOld.txt"
# echo "idf_build_get_property(target IDF_TARGET)" > "$AR_COMPS/esp-dl/CMakeLists.txt"
# echo "if(NOT \${IDF_TARGET} STREQUAL \"esp32c6\" AND NOT \${IDF_TARGET} STREQUAL \"esp32h2\")" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
# cat "$AR_COMPS/esp-dl/CMakeListsOld.txt" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
# echo "endif()" >> "$AR_COMPS/esp-dl/CMakeLists.txt"
# rm -rf "$AR_COMPS/esp-dl/CMakeListsOld.txt"
#else
# git -C "$AR_COMPS/esp-dl" fetch && \
# git -C "$AR_COMPS/esp-dl" pull --ff-only
#fi
#if [ $? -ne 0 ]; then exit 1; fi
#this is a temp measure to fix build issue
#if [ -f "$AR_COMPS/esp-dl/idf_component.yml" ]; then
# rm -rf "$AR_COMPS/esp-dl/idf_component.yml"
#fi
#
# CLONE/UPDATE ESP-SR
#
#echo "Updating ESP-SR..."
#if [ ! -d "$AR_COMPS/esp-sr" ]; then
# git clone $SR_REPO_URL "$AR_COMPS/esp-sr"
#else
# git -C "$AR_COMPS/esp-sr" fetch && \
# git -C "$AR_COMPS/esp-sr" pull --ff-only
#fi
#if [ $? -ne 0 ]; then exit 1; fi
#
# CLONE/UPDATE ESP-RAINMAKER
#
#echo "Updating ESP-RainMaker..."
#if [ ! -d "$AR_COMPS/esp-rainmaker" ]; then
# git clone $RMAKER_REPO_URL "$AR_COMPS/esp-rainmaker" && \
# git -C "$AR_COMPS/esp-rainmaker" reset --hard d8e93454f495bd8a414829ec5e86842b373ff555 && \
# git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
# else
# git -C "$AR_COMPS/esp-rainmaker" fetch && \
# git -C "$AR_COMPS/esp-rainmaker" pull --ff-only && \
# git -C "$AR_COMPS/esp-rainmaker" submodule update --init --recursive
#fi
#if [ $? -ne 0 ]; then exit 1; fi
#this is a temp measure to fix build issue
#if [ -f "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" ] && [ `cat "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py" | grep esp32c6 | wc -l` == "0" ]; then
# echo "Overwriting 'get_projbuild_gitconfig.py'"
# cp -f "tools/get_projbuild_gitconfig.py" "$AR_COMPS/esp-rainmaker/components/esp-insights/components/esp_insights/scripts/get_projbuild_gitconfig.py"
#fi
#
# CLONE/UPDATE ESP-LITTLEFS
#
#echo "Updating ESP-LITTLEFS..."
#if [ ! -d "$AR_COMPS/esp_littlefs" ]; then
# git clone $LITTLEFS_REPO_URL "$AR_COMPS/esp_littlefs" && \
# git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
#else
# git -C "$AR_COMPS/esp_littlefs" fetch && \
# git -C "$AR_COMPS/esp_littlefs" pull --ff-only && \
# git -C "$AR_COMPS/esp_littlefs" submodule update --init --recursive
#fi
#if [ $? -ne 0 ]; then exit 1; fi
# #
# CLONE/UPDATE TINYUSB # CLONE/UPDATE TINYUSB
# #
echo "Updating TinyUSB..." echo "Updating TinyUSB..."
if [ ! -d "$AR_COMPS/arduino_tinyusb/tinyusb" ]; then TINYUSB_REPO_URL="https://github.com/hathach/tinyusb.git"
git clone $TINYUSB_REPO_URL "$AR_COMPS/arduino_tinyusb/tinyusb" TINYUSB_REPO_DIR="$AR_COMPS/arduino_tinyusb/tinyusb"
if [ ! -d "$TINYUSB_REPO_DIR" ]; then
git clone "$TINYUSB_REPO_URL" "$TINYUSB_REPO_DIR"
else else
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" fetch && \ git -C "$TINYUSB_REPO_DIR" fetch && \
git -C "$AR_COMPS/arduino_tinyusb/tinyusb" pull --ff-only git -C "$TINYUSB_REPO_DIR" pull --ff-only
fi fi
if [ $? -ne 0 ]; then exit 1; fi if [ $? -ne 0 ]; then exit 1; fi
#
# CLONE/UPDATE TFLITE MICRO
#
#echo "Updating TFLite Micro..."
#if [ ! -d "$AR_COMPS/tflite-micro" ]; then
# git clone $TFLITE_REPO_URL "$AR_COMPS/tflite-micro"
# git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive
#else
# git -C "$AR_COMPS/tflite-micro" fetch && \
# git -C "$AR_COMPS/tflite-micro" pull --ff-only
# git -C "$AR_COMPS/tflite-micro" submodule update --init --recursive
#fi
#if [ $? -ne 0 ]; then exit 1; fi