Skip to content

Commit b769846

Browse files
authored
Merge branch 'master' into release/v3.3.x
2 parents 15038e6 + f3ae2a6 commit b769846

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

cores/esp32/esp32-hal-cpu.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include "soc/efuse_reg.h"
2727
#include "esp32-hal.h"
2828
#include "esp32-hal-cpu.h"
29+
#include "hal/timer_ll.h"
30+
#include "esp_private/systimer.h"
2931

3032
#include "esp_system.h"
3133
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
@@ -175,7 +177,9 @@ static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) {
175177
#endif
176178
}
177179

180+
#if defined(CONFIG_IDF_TARGET_ESP32) && !defined(LACT_MODULE) && !defined(LACT_TICKS_PER_US)
178181
void esp_timer_impl_update_apb_freq(uint32_t apb_ticks_per_us); //private in IDF
182+
#endif
179183

180184
bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
181185
rtc_cpu_freq_config_t conf, cconf;
@@ -248,7 +252,13 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
248252
//Update APB Freq REG
249253
rtc_clk_apb_freq_update(apb);
250254
//Update esp_timer divisor
255+
#if CONFIG_IDF_TARGET_ESP32
256+
#if defined(LACT_MODULE) && defined(LACT_TICKS_PER_US)
257+
timer_ll_set_lact_clock_prescale(TIMER_LL_GET_HW(LACT_MODULE), apb / MHZ / LACT_TICKS_PER_US);
258+
#else
251259
esp_timer_impl_update_apb_freq(apb / MHZ);
260+
#endif
261+
#endif
252262
}
253263
#endif
254264
//Update FreeRTOS Tick Divisor

libraries/NetworkClientSecure/src/NetworkClientSecure.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ int NetworkClientSecure::available() {
315315
}
316316

317317
uint8_t NetworkClientSecure::connected() {
318-
uint8_t dummy = 0;
319-
read(&dummy, 0);
320-
318+
if (_connected) {
319+
uint8_t dummy = 0;
320+
read(&dummy, 0);
321+
}
321322
return _connected;
322323
}
323324

0 commit comments

Comments
 (0)