Skip to content

Commit 8a7cdb8

Browse files
committed
Merge branch 'esp-idf-v5.1-libs' into BTser_fix
2 parents b5a09c4 + 9d3fa6b commit 8a7cdb8

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

cores/esp32/MD5Builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
7878
// read data and check if we got something
7979
int numBytesRead = stream.readBytes(buf, readBytes);
8080
if(numBytesRead< 1) {
81+
free(buf);
8182
return false;
8283
}
8384

cores/esp32/esp32-hal-misc.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,14 @@ extern bool btInUse();
249249

250250
void initArduino()
251251
{
252+
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
253+
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
254+
#ifdef F_CPU
255+
setCpuFrequencyMhz(F_CPU/1000000);
256+
#endif
257+
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
258+
psramInit();
259+
#endif
252260
#ifdef CONFIG_APP_ROLLBACK_ENABLE
253261
if(!verifyRollbackLater()){
254262
const esp_partition_t *running = esp_ota_get_running_partition();
@@ -264,14 +272,6 @@ void initArduino()
264272
}
265273
}
266274
}
267-
#endif
268-
//init proper ref tick value for PLL (uncomment if REF_TICK is different than 1MHz)
269-
//ESP_REG(APB_CTRL_PLL_TICK_CONF_REG) = APB_CLK_FREQ / REF_CLK_FREQ - 1;
270-
#ifdef F_CPU
271-
setCpuFrequencyMhz(F_CPU/1000000);
272-
#endif
273-
#if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM
274-
psramInit();
275275
#endif
276276
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
277277
esp_err_t err = nvs_flash_init();

libraries/WiFiProv/examples/WiFiProv/WiFiProv.ino

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,21 @@ void setup() {
6262
Serial.begin(115200);
6363
WiFi.onEvent(SysProvEvent);
6464

65-
#if CONFIG_IDF_TARGET_ESP32 && CONFIG_BLUEDROID_ENABLED && not USE_SOFT_AP
65+
// BLE Provisioning using the ESP SoftAP Prov works fine for any BLE SoC, incuding ESP32, ESP32S3 and ESP32C3.
66+
#if CONFIG_BLUEDROID_ENABLED && !defined(USE_SOFT_AP)
6667
Serial.println("Begin Provisioning using BLE");
6768
// Sample uuid that user can pass during provisioning using BLE
6869
uint8_t uuid[16] = {0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf,
6970
0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02 };
7071
WiFiProv.beginProvision(WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, pop, service_name, service_key, uuid, reset_provisioned);
72+
log_d("ble qr");
73+
WiFiProv.printQR(service_name, pop, "ble");
7174
#else
7275
Serial.println("Begin Provisioning using Soft AP");
7376
WiFiProv.beginProvision(WIFI_PROV_SCHEME_SOFTAP, WIFI_PROV_SCHEME_HANDLER_NONE, WIFI_PROV_SECURITY_1, pop, service_name, service_key);
74-
#endif
75-
76-
#if CONFIG_BLUEDROID_ENABLED && not USE_SOFT_AP
77-
log_d("ble qr");
78-
WiFiProv.printQR(service_name, pop, "ble");
79-
#else
8077
log_d("wifi qr");
8178
WiFiProv.printQR(service_name, pop, "softap");
82-
#endif
79+
#endif
8380
}
8481

8582
void loop() {

tools/platformio-build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ def add_tinyuf2_extra_image():
169169
# Target: Build Core Library
170170
#
171171

172+
# Set -DARDUINO_CORE_BUILD only for the core library
173+
corelib_env = env.Clone()
174+
corelib_env.Append(CPPDEFINES=["ARDUINO_CORE_BUILD"])
175+
172176
libs = []
173177

174178
variants_dir = join(FRAMEWORK_DIR, "variants")
@@ -178,13 +182,14 @@ def add_tinyuf2_extra_image():
178182

179183
if "build.variant" in board_config:
180184
env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))])
181-
env.BuildSources(
185+
corelib_env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))])
186+
corelib_env.BuildSources(
182187
join("$BUILD_DIR", "FrameworkArduinoVariant"),
183188
join(variants_dir, board_config.get("build.variant")),
184189
)
185190

186191
libs.append(
187-
env.BuildLibrary(
192+
corelib_env.BuildLibrary(
188193
join("$BUILD_DIR", "FrameworkArduino"),
189194
join(FRAMEWORK_DIR, "cores", board_config.get("build.core")),
190195
)

0 commit comments

Comments
 (0)