esp_wifi: Add API to get available internal heap size.

This commit is contained in:
xiehang
2020-05-28 16:53:54 +08:00
committed by zhangyanjiao
parent 1e8f68f829
commit 58d37de620
4 changed files with 17 additions and 2 deletions
@@ -117,6 +117,16 @@ esp_reset_reason_t esp_reset_reason(void);
*/
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);
/**
* @brief Get the minimum heap that has ever been available
*
+5
View File
@@ -51,6 +51,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 );