Skip to content

Commit 57d7c3f

Browse files
authored
Merge branch 'master' into Zigbee-examples
2 parents fbc827f + e9ee9c1 commit 57d7c3f

File tree

20 files changed

+686
-327
lines changed

20 files changed

+686
-327
lines changed

Diff for: .github/scripts/on-push.sh

+6-12
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,16 @@ if [ "$BUILD_PIO" -eq 0 ]; then
7373

7474
SKETCHES_ESP32="\
7575
$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
76-
$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino\
76+
$ARDUINO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino\
7777
$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino\
7878
$ARDUINO_ESP32_PATH/libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino\
7979
"
8080

81-
SKETCHES_ESP32XX="\
82-
$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino\
83-
$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino\
84-
$ARDUINO_ESP32_PATH/libraries/Insights/examples/MinimalDiagnostics/MinimalDiagnostics.ino\
85-
"
86-
8781
build "esp32s3" $FQBN_ESP32S3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
88-
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
89-
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
90-
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
91-
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32XX
82+
build "esp32s2" $FQBN_ESP32S2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
83+
build "esp32c3" $FQBN_ESP32C3 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
84+
build "esp32c6" $FQBN_ESP32C6 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
85+
build "esp32h2" $FQBN_ESP32H2 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
9286
build "esp32" $FQBN_ESP32 $CHUNK_INDEX $CHUNKS_CNT $SKETCHES_ESP32
9387
else
9488
source ${SCRIPTS_DIR}/install-platformio-esp32.sh
@@ -98,7 +92,7 @@ else
9892
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
9993
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
10094
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
101-
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
95+
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/Server/Server.ino" && \
10296
build_pio_sketch "$BOARD" "$OPTIONS" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
10397

10498
# Basic sanity testing for other series

Diff for: .github/scripts/sketch_utils.sh

+16
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
126126
# of configuration built in case of a multiconfiguration test.
127127

128128
sketchname=$(basename $sketchdir)
129+
130+
if [[ -n $target ]] && [[ -f "$sketchdir/.skip.$target" ]]; then
131+
echo "Skipping $sketchname for target $target"
132+
exit 0
133+
fi
129134

130135
ARDUINO_CACHE_DIR="$HOME/.arduino/cache.tmp"
131136
if [ -n "$ARDUINO_BUILD_DIR" ]; then
@@ -159,6 +164,12 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
159164
--build-cache-path "$ARDUINO_CACHE_DIR" \
160165
--build-path "$build_dir" \
161166
$xtra_opts "${sketchdir}"
167+
168+
exit_status=$?
169+
if [ $exit_status -ne 0 ]; then
170+
echo ""ERROR: Compilation failed with error code $exit_status""
171+
exit $exit_status
172+
fi
162173
elif [ -f "$ide_path/arduino-builder" ]; then
163174
echo "Building $sketchname with arduino-builder and FQBN=$currfqbn"
164175
echo "Build path = $build_dir"
@@ -173,6 +184,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
173184
-build-path "$build_dir" \
174185
$xtra_opts "${sketchdir}/${sketchname}.ino"
175186

187+
exit_status=$?
188+
if [ $exit_status -ne 0 ]; then
189+
echo ""ERROR: Compilation failed with error code $exit_status""
190+
exit $exit_status
191+
fi
176192
# $ide_path/arduino-builder -compile -logger=human -core-api-version=10810 \
177193
# -fqbn=\"$currfqbn\" \
178194
# -warnings="all" \

Diff for: cores/esp32/Esp.cpp

+10-9
Original file line numberDiff line numberDiff line change
@@ -225,30 +225,31 @@ String EspClass::getSketchMD5()
225225
const esp_partition_t *running = esp_ota_get_running_partition();
226226
if (!running) {
227227
log_e("Partition could not be found");
228-
229228
return String();
230229
}
230+
231231
const size_t bufSize = SPI_FLASH_SEC_SIZE;
232-
std::unique_ptr<uint8_t[]> buf(new uint8_t[bufSize]);
233-
uint32_t offset = 0;
234-
if(!buf.get()) {
232+
uint8_t *pb = (uint8_t *)malloc(bufSize);
233+
if(!pb) {
235234
log_e("Not enough memory to allocate buffer");
236-
237235
return String();
238236
}
237+
uint32_t offset = 0;
238+
239239
MD5Builder md5;
240240
md5.begin();
241-
while( lengthLeft > 0) {
241+
while(lengthLeft > 0) {
242242
size_t readBytes = (lengthLeft < bufSize) ? lengthLeft : bufSize;
243-
if (!ESP.flashRead(running->address + offset, reinterpret_cast<uint32_t*>(buf.get()), (readBytes + 3) & ~3)) {
243+
if (!ESP.flashRead(running->address + offset, (uint32_t *)pb, (readBytes + 3) & ~3)) {
244+
free(pb);
244245
log_e("Could not read buffer from flash");
245-
246246
return String();
247247
}
248-
md5.add(buf.get(), readBytes);
248+
md5.add(pb, readBytes);
249249
lengthLeft -= readBytes;
250250
offset += readBytes;
251251
}
252+
free(pb);
252253
md5.calculate();
253254
result = md5.toString();
254255
return result;

0 commit comments

Comments
 (0)