@@ -53,7 +53,6 @@ function get_actual_path(){
53
53
}
54
54
55
55
# Include-Pfad-Verkürzung Funktionen (für statische Generierung)
56
- # Das Build-Zeit Framework-Verzeichnis (ESP-IDF Quellen)
57
56
if [ -n " $IDF_PATH " ]; then
58
57
BUILD_FRAMEWORK_DIR=" $IDF_PATH "
59
58
elif [ -d " ../esp-idf" ]; then
65
64
is_framework_subfolder () {
66
65
local potential_subfolder=" $1 "
67
66
68
- # Prüfe ob absoluter Pfad
69
67
if [[ " $potential_subfolder " != /* ]]; then
70
68
return 1
71
69
fi
72
70
73
- # Prüfe ob auf gleichem Laufwerk
74
71
local sdk_drive=" ${BUILD_FRAMEWORK_DIR%%:* } "
75
72
local sub_drive=" ${potential_subfolder%%:* } "
76
73
if [[ " $sdk_drive " != " $sub_drive " ]]; then
77
74
return 1
78
75
fi
79
76
80
- # Prüfe ob Unterordner (analog zu Python os.path.commonpath)
81
77
case " $potential_subfolder " in
82
78
" $BUILD_FRAMEWORK_DIR " * )
83
79
return 0
@@ -93,39 +89,39 @@ shorten_includes() {
93
89
local shortened_includes=" "
94
90
local generic_includes=" "
95
91
96
- # Konvertiere Include-String zu Array
97
92
IFS=' ' read -ra includes_array <<< " $includes_str"
98
93
99
94
for inc in " ${includes_array[@]} " ; do
100
95
if [[ -n " $inc " ]]; then
101
96
if is_framework_subfolder " $inc " ; then
102
- # Mappe auf die kopierte Struktur im Arduino Framework
103
97
local rel_path=" ${inc# $BUILD_FRAMEWORK_DIR } "
104
- rel_path=" ${rel_path#/ } " # Entferne führenden Slash
98
+ rel_path=" ${rel_path#/ } "
105
99
106
- # Konvertiere ESP-IDF Pfad zu Arduino Framework Pfad
107
100
if [[ " $rel_path " == " components/" * ]]; then
108
- # components/freertos/include -> include/freertos
109
101
local component_path=" ${rel_path# components/ } "
110
102
local component_name=" ${component_path%%/* } "
111
103
local sub_path=" ${component_path#*/ } "
112
104
if [[ " $sub_path " == " include" ]]; then
113
105
shortened_includes+=" -iwithprefix/include/$component_name "
106
+ elif [[ " $sub_path " == " include/" * ]]; then
107
+ local remaining_path=" ${sub_path# include/ } "
108
+ shortened_includes+=" -iwithprefix/include/$component_name /$remaining_path "
114
109
else
115
110
shortened_includes+=" -iwithprefix/include/$component_name /$sub_path "
116
111
fi
117
112
elif [[ " $rel_path " == " managed_components/" * ]]; then
118
- # managed_components/esp32-camera/include -> include/esp32-camera
119
113
local component_path=" ${rel_path# managed_components/ } "
120
114
local component_name=" ${component_path%%/* } "
121
115
local sub_path=" ${component_path#*/ } "
122
116
if [[ " $sub_path " == " include" ]]; then
123
117
shortened_includes+=" -iwithprefix/include/$component_name "
118
+ elif [[ " $sub_path " == " include/" * ]]; then
119
+ local remaining_path=" ${sub_path# include/ } "
120
+ shortened_includes+=" -iwithprefix/include/$component_name /$remaining_path "
124
121
else
125
122
shortened_includes+=" -iwithprefix/include/$component_name /$sub_path "
126
123
fi
127
124
else
128
- # Andere Pfade direkt mappen
129
125
shortened_includes+=" -iwithprefix/$rel_path "
130
126
fi
131
127
else
@@ -134,7 +130,6 @@ shorten_includes() {
134
130
fi
135
131
done
136
132
137
- # Rückgabe: "generic_includes|shortened_includes"
138
133
echo " $generic_includes |$shortened_includes "
139
134
}
140
135
177
172
# copy zigbee + zboss lib
178
173
if [ -d " managed_components/espressif__esp-zigbee-lib/lib/$IDF_TARGET /" ]; then
179
174
cp -r " managed_components/espressif__esp-zigbee-lib/lib/$IDF_TARGET " /* " $AR_SDK /lib/"
180
- EXCLUDE_LIBS+=" esp_zb_api_ed ;"
175
+ EXCLUDE_LIBS+=" esp_zb_api.ed;esp_zb_api.zczr ;"
181
176
fi
182
177
183
178
if [ -d " managed_components/espressif__esp-zboss-lib/lib/$IDF_TARGET /" ]; then
184
179
cp -r " managed_components/espressif__esp-zboss-lib/lib/$IDF_TARGET " /* " $AR_SDK /lib/"
185
- EXCLUDE_LIBS+=" zboss_stack.ed;zboss_port.debug;"
180
+ EXCLUDE_LIBS+=" zboss_stack.ed;zboss_stack.zczr; zboss_port.native;zboss_port.native.debug;zboss_port.remote;zboss_port.remote .debug;"
186
181
fi
187
182
188
183
# collect includes, defines and c-flags
@@ -512,13 +507,15 @@ echo " '-Wl,-Map=\"%s\"' % join(\"\${BUILD_DIR}\", \"\${PROGNAME}.map\")"
512
507
echo " ]," >> " $AR_PLATFORMIO_PY "
513
508
echo " " >> " $AR_PLATFORMIO_PY "
514
509
515
- # CPPPATH nur mit kopierten Headers
510
+ # CPPPATH NUR mit Arduino Core - KEINE kopierten Headers!
516
511
echo " CPPPATH=[" >> " $AR_PLATFORMIO_PY "
512
+ echo " join($PIO_SDK , board_config.get(\" build.arduino.memory_type\" , (board_config.get(\" build.flash_mode\" , \" dio\" ) + \" _qspi\" )), \" include\" )," >> " $AR_PLATFORMIO_PY "
513
+ echo " join(FRAMEWORK_DIR, \" cores\" , board_config.get(\" build.core\" ))" >> " $AR_PLATFORMIO_PY "
514
+ echo " ]," >> " $AR_PLATFORMIO_PY "
515
+ echo " " >> " $AR_PLATFORMIO_PY "
517
516
518
- # Bestehende CPPPATH-Logik für kopierte Headers
519
- REL_INC=" "
517
+ # Headers kopieren (aber NICHT zu CPPPATH hinzufügen)
520
518
set -- $INCLUDES
521
-
522
519
for item; do
523
520
if [[ " $item " != $PWD ]]; then
524
521
ipath=" $item "
@@ -541,14 +538,8 @@ for item; do
541
538
542
539
out_sub=" ${item#* $ipath } "
543
540
out_cpath=" $AR_SDK /include/$fname$out_sub "
544
- REL_INC+=" -iwithprefixbefore $fname$out_sub "
545
- if [ " $out_sub " = " " ]; then
546
- echo " join($PIO_SDK , \" include\" , \" $fname \" )," >> " $AR_PLATFORMIO_PY "
547
- else
548
- pio_sub=" ${out_sub: 1} "
549
- pio_sub=` echo $pio_sub | sed ' s/\//\\", \\"/g' `
550
- echo " join($PIO_SDK , \" include\" , \" $fname \" , \" $pio_sub \" )," >> " $AR_PLATFORMIO_PY "
551
- fi
541
+
542
+ # Headers kopieren
552
543
for f in ` find " $item " -name ' *.h' ` ; do
553
544
rel_f=${f#* $item }
554
545
rel_p=${rel_f%/* }
@@ -567,17 +558,14 @@ for item; do
567
558
mkdir -p " $out_cpath$rel_p "
568
559
cp -n $f " $out_cpath$rel_p /"
569
560
done
561
+
570
562
# Temporary measure to fix issues caused by https://github.com/espressif/esp-idf/commit/dc4731101dd567cc74bbe4d0f03afe52b7db9afb#diff-1d2ce0d3989a80830fdf230bcaafb3117f32046d16cf46616ac3d55b4df2a988R17
571
563
if [[ " $fname " == " bt" && " $out_sub " == " /include/$IDF_TARGET /include" && -f " $ipath /controller/$IDF_TARGET /esp_bt_cfg.h" ]]; then
572
564
mkdir -p " $AR_SDK /include/$fname /controller/$IDF_TARGET "
573
565
cp -n " $ipath /controller/$IDF_TARGET /esp_bt_cfg.h" " $AR_SDK /include/$fname /controller/$IDF_TARGET /esp_bt_cfg.h"
574
566
fi
575
567
fi
576
568
done
577
- echo " join($PIO_SDK , board_config.get(\" build.arduino.memory_type\" , (board_config.get(\" build.flash_mode\" , \" dio\" ) + \" _qspi\" )), \" include\" )," >> " $AR_PLATFORMIO_PY "
578
- echo " join(FRAMEWORK_DIR, \" cores\" , board_config.get(\" build.core\" ))" >> " $AR_PLATFORMIO_PY "
579
- echo " ]," >> " $AR_PLATFORMIO_PY "
580
- echo " " >> " $AR_PLATFORMIO_PY "
581
569
582
570
AR_LIBS=" $LD_LIBS "
583
571
PIO_LIBS=" "
@@ -636,7 +624,6 @@ DEFINES=`echo "$DEFINES" | tr -s '\'`
636
624
FLAGS_DIR=" $AR_SDK /flags"
637
625
mkdir -p " $FLAGS_DIR "
638
626
echo -n " $DEFINES " > " $FLAGS_DIR /defines"
639
- echo -n " $REL_INC " > " $FLAGS_DIR /includes"
640
627
echo -n " $C_FLAGS " > " $FLAGS_DIR /c_flags"
641
628
echo -n " $CPP_FLAGS " > " $FLAGS_DIR /cpp_flags"
642
629
echo -n " $AS_FLAGS " > " $FLAGS_DIR /S_flags"
@@ -712,3 +699,4 @@ done;
712
699
# Add IDF versions to sdkconfig
713
700
echo " #define CONFIG_ARDUINO_IDF_COMMIT \" $IDF_COMMIT \" " >> " $AR_SDK /$MEMCONF /include/sdkconfig.h"
714
701
echo " #define CONFIG_ARDUINO_IDF_BRANCH \" $IDF_BRANCH \" " >> " $AR_SDK /$MEMCONF /include/sdkconfig.h"
702
+
0 commit comments