File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
libraries/NetworkClientSecure/src Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 26
26
#include "soc/efuse_reg.h"
27
27
#include "esp32-hal.h"
28
28
#include "esp32-hal-cpu.h"
29
+ #include "hal/timer_ll.h"
30
+ #include "esp_private/systimer.h"
29
31
30
32
#include "esp_system.h"
31
33
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
@@ -175,7 +177,9 @@ static uint32_t calculateApb(rtc_cpu_freq_config_t *conf) {
175
177
#endif
176
178
}
177
179
180
+ #if defined(CONFIG_IDF_TARGET_ESP32 ) && !defined(LACT_MODULE ) && !defined(LACT_TICKS_PER_US )
178
181
void esp_timer_impl_update_apb_freq (uint32_t apb_ticks_per_us ); //private in IDF
182
+ #endif
179
183
180
184
bool setCpuFrequencyMhz (uint32_t cpu_freq_mhz ) {
181
185
rtc_cpu_freq_config_t conf , cconf ;
@@ -248,7 +252,13 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
248
252
//Update APB Freq REG
249
253
rtc_clk_apb_freq_update (apb );
250
254
//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
251
259
esp_timer_impl_update_apb_freq (apb / MHZ );
260
+ #endif
261
+ #endif
252
262
}
253
263
#endif
254
264
//Update FreeRTOS Tick Divisor
Original file line number Diff line number Diff line change @@ -315,9 +315,10 @@ int NetworkClientSecure::available() {
315
315
}
316
316
317
317
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
+ }
321
322
return _connected;
322
323
}
323
324
You can’t perform that action at this time.
0 commit comments