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 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 )
178181void esp_timer_impl_update_apb_freq (uint32_t apb_ticks_per_us ); //private in IDF
182+ #endif
179183
180184bool 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
Original file line number Diff line number Diff line change @@ -315,9 +315,10 @@ int NetworkClientSecure::available() {
315315}
316316
317317uint8_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
You can’t perform that action at this time.
0 commit comments