diff --git a/components/esp32/esp_adapter.c b/components/esp32/esp_adapter.c index 18c4b0181..25e81d201 100644 --- a/components/esp32/esp_adapter.c +++ b/components/esp32/esp_adapter.c @@ -551,7 +551,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = { ._task_get_max_priority = task_get_max_priority_wrapper, ._malloc = malloc, ._free = free, - ._get_free_heap_size = esp_get_free_heap_size, + ._get_free_heap_size = esp_get_free_internal_heap_size, ._rand = esp_random, ._dport_access_stall_other_cpu_start_wrap = esp_dport_access_stall_other_cpu_start_wrap, ._dport_access_stall_other_cpu_end_wrap = esp_dport_access_stall_other_cpu_end_wrap, diff --git a/components/esp32/include/esp_system.h b/components/esp32/include/esp_system.h index 782147181..1afbe1fdc 100644 --- a/components/esp32/include/esp_system.h +++ b/components/esp32/include/esp_system.h @@ -130,6 +130,16 @@ uint32_t system_get_time(void) __attribute__ ((deprecated)); */ uint32_t esp_get_free_heap_size(void); +/** + * @brief Get the size of available internal heap. + * + * Note that the returned value may be larger than the maximum contiguous block + * which can be allocated. + * + * @return Available internal heap size, in bytes. + */ +uint32_t esp_get_free_internal_heap_size(void); + /** @cond */ /** * @brief Get the size of available heap. diff --git a/components/esp32/include/esp_wifi_types.h b/components/esp32/include/esp_wifi_types.h index c838c3eef..f7786f5a0 100644 --- a/components/esp32/include/esp_wifi_types.h +++ b/components/esp32/include/esp_wifi_types.h @@ -93,6 +93,7 @@ typedef enum { WIFI_REASON_ASSOC_FAIL = 203, WIFI_REASON_HANDSHAKE_TIMEOUT = 204, WIFI_REASON_CONNECTION_FAIL = 205, + WIFI_REASON_AP_TSF_RESET = 206, } wifi_err_reason_t; typedef enum { diff --git a/components/esp32/lib b/components/esp32/lib index 396d8a29d..d5de1af54 160000 --- a/components/esp32/lib +++ b/components/esp32/lib @@ -1 +1 @@ -Subproject commit 396d8a29d13e053ade4d0ffeab47a0b4feb17a81 +Subproject commit d5de1af54301903f47eb81635b65f2b074700422 diff --git a/components/esp32/system_api.c b/components/esp32/system_api.c index 81de6c30e..d38570420 100644 --- a/components/esp32/system_api.c +++ b/components/esp32/system_api.c @@ -363,6 +363,11 @@ uint32_t esp_get_free_heap_size( void ) return heap_caps_get_free_size( MALLOC_CAP_DEFAULT ); } +uint32_t esp_get_free_internal_heap_size( void ) +{ + return heap_caps_get_free_size( MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL ); +} + uint32_t esp_get_minimum_free_heap_size( void ) { return heap_caps_get_minimum_free_size( MALLOC_CAP_DEFAULT );