Skip to content

Commit 71b93ab

Browse files
authored
Enhance Bluetooth config file copying for SOCs
Added logic to copy Bluetooth configuration files for specific SOCs in the copy-libs.sh script.
1 parent ea4921a commit 71b93ab

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

tools/copy-libs.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,17 @@ for item; do
461461
mkdir -p "$out_cpath$rel_p"
462462
cp -n $f "$out_cpath$rel_p/"
463463
done
464-
# Temporary measure to fix issues caused by https://github.com/espressif/esp-idf/commit/dc4731101dd567cc74bbe4d0f03afe52b7db9afb#diff-1d2ce0d3989a80830fdf230bcaafb3117f32046d16cf46616ac3d55b4df2a988R17
465-
if [[ "$fname" == "bt" && "$out_sub" == "/include/$IDF_TARGET/include" && -f "$ipath/controller/$IDF_TARGET/esp_bt_cfg.h" ]]; then
466-
mkdir -p "$AR_SDK/include/$fname/controller/$IDF_TARGET"
467-
cp -n "$ipath/controller/$IDF_TARGET/esp_bt_cfg.h" "$AR_SDK/include/$fname/controller/$IDF_TARGET/esp_bt_cfg.h"
464+
465+
# Copy the the files in /include/esp32*/include for the soc found in bt
466+
# This is necessary as there might be cross soc dependencies in the bt component.
467+
# For example, the esp32c61 requires the esp_bt_cfg.h and esp_bt.h from the esp32c6.
468+
if [[ "$fname" == "bt" && "$out_sub" =~ ^/include/esp32[^/]+/include$ ]]; then
469+
soc_name=$(echo "$out_sub" | sed -n 's|/include/\(esp32[^/]*\)/include$|\1|p')
470+
echo "Copying bt config file for soc: $soc_name"
471+
if [ -n "$soc_name" ] && [ -f "$ipath/controller/$soc_name/esp_bt_cfg.h" ]; then
472+
mkdir -p "$AR_SDK/include/$fname/controller/$soc_name"
473+
cp -n "$ipath/controller/$soc_name/esp_bt_cfg.h" "$AR_SDK/include/$fname/controller/$soc_name/esp_bt_cfg.h"
474+
fi
468475
fi
469476
fi
470477
done

0 commit comments

Comments
 (0)