mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
feat(ble/controller): Support get BLE controller free heap size
This commit is contained in:
parent
ad9cdcd11a
commit
946f484861
@ -96,6 +96,7 @@ do{\
|
|||||||
#define OSI_VERSION 0x00010005
|
#define OSI_VERSION 0x00010005
|
||||||
#define OSI_MAGIC_VALUE 0xFADEBEAD
|
#define OSI_MAGIC_VALUE 0xFADEBEAD
|
||||||
|
|
||||||
|
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL)
|
||||||
/* Types definition
|
/* Types definition
|
||||||
************************************************************************
|
************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -868,7 +869,21 @@ static int IRAM_ATTR cause_sw_intr_to_core_wrapper(int core_id, int intr_no)
|
|||||||
|
|
||||||
static void *malloc_internal_wrapper(size_t size)
|
static void *malloc_internal_wrapper(size_t size)
|
||||||
{
|
{
|
||||||
return heap_caps_malloc(size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
|
return heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *malloc_ble_controller_mem(size_t size)
|
||||||
|
{
|
||||||
|
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
|
||||||
|
if(p == NULL) {
|
||||||
|
ESP_LOGE(BTDM_LOG_TAG, "Malloc failed");
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t get_ble_controller_free_heap_size(void)
|
||||||
|
{
|
||||||
|
return heap_caps_get_free_size(BLE_CONTROLLER_MALLOC_CAPS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
|
static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
|
||||||
|
@ -120,6 +120,7 @@ do{\
|
|||||||
|
|
||||||
#define BLE_PWR_HDL_INVL 0xFFFF
|
#define BLE_PWR_HDL_INVL 0xFFFF
|
||||||
|
|
||||||
|
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA)
|
||||||
/* Types definition
|
/* Types definition
|
||||||
************************************************************************
|
************************************************************************
|
||||||
*/
|
*/
|
||||||
@ -689,13 +690,27 @@ static bool IRAM_ATTR is_in_isr_wrapper(void)
|
|||||||
|
|
||||||
static void *malloc_internal_wrapper(size_t size)
|
static void *malloc_internal_wrapper(size_t size)
|
||||||
{
|
{
|
||||||
void *p = heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA);
|
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
|
||||||
if(p == NULL) {
|
if(p == NULL) {
|
||||||
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
|
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void *malloc_ble_controller_mem(size_t size)
|
||||||
|
{
|
||||||
|
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
|
||||||
|
if(p == NULL) {
|
||||||
|
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t get_ble_controller_free_heap_size(void)
|
||||||
|
{
|
||||||
|
return heap_caps_get_free_size(BLE_CONTROLLER_MALLOC_CAPS);
|
||||||
|
}
|
||||||
|
|
||||||
static int IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
|
static int IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
|
||||||
{
|
{
|
||||||
int ret = esp_read_mac(mac, ESP_MAC_BT);
|
int ret = esp_read_mac(mac, ESP_MAC_BT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user