fix(nimble): Changing ets_pintf to ESP_LOGI when memory allocation fails

This commit is contained in:
Abhinav Kudnar
2024-12-09 18:13:15 +08:00
committed by Rahul Tank
parent bac3aa9d4e
commit 7d350d5ed1
2 changed files with 5 additions and 13 deletions
+5 -4
View File
@@ -36,6 +36,7 @@
#include "os/os.h"
#include "os/os_trace_api.h"
#include "modlog/modlog.h"
#include "esp_log.h"
#include <assert.h>
#include <stddef.h>
@@ -189,8 +190,8 @@ os_msys_get(uint16_t dsize, uint16_t leadingspace)
return (m);
err:
log_count ++;
if ((log_count % 40) == 0) {
ets_printf("_os_msys_find_pool failed (size %u)\n",dsize);
if ((log_count % 100) == 0) {
ESP_LOGI("ESP_LOG_INFO","_os_msys_find_pool failed (size %u)\n",dsize);
log_count = 0;
}
@@ -214,8 +215,8 @@ os_msys_get_pkthdr(uint16_t dsize, uint16_t user_hdr_len)
return (m);
err:
log_count ++;
if ((log_count % 40) == 0) {
ets_printf("_os_msys_find_pool failed (size %u)\n",dsize);
if ((log_count % 100) == 0) {
ESP_LOGI("ESP_LOG_INFO","_os_msys_find_pool failed (size %u)\n",dsize);
log_count = 0;
}
return (NULL);
-9
View File
@@ -41,7 +41,6 @@
STAILQ_HEAD(, os_mempool) g_os_mempool_list = STAILQ_HEAD_INITIALIZER(g_os_mempool_list);
static uint8_t log_count;
#if MYNEWT_VAL(OS_MEMPOOL_POISON)
static uint32_t os_mem_poison = 0xde7ec7ed;
@@ -375,14 +374,6 @@ os_memblock_get(struct os_mempool *mp)
os_trace_api_ret_u32(OS_TRACE_ID_MEMBLOCK_GET, (uint32_t)(uintptr_t)block);
if(!block){
log_count ++;
if ((log_count % 40) == 0) {
ets_printf("os_memblock_get failed (size %u)\n",sizeof *block);
log_count = 0;
}
}
return (void *)block;
}