mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-08-06 07:00:05 +08:00
feat(sdk): Midify "__FILE__" to "__ESP_FILE__" for some components
This commit is contained in:
@ -105,7 +105,7 @@ void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const cha
|
||||
#define ESP_ERROR_CHECK(x) do { \
|
||||
esp_err_t __err_rc = (x); \
|
||||
if (__err_rc != ESP_OK) { \
|
||||
_esp_error_check_failed(__err_rc, __FILE__, __LINE__, \
|
||||
_esp_error_check_failed(__err_rc, __ESP_FILE__, __LINE__, \
|
||||
__ASSERT_FUNC, #x); \
|
||||
} \
|
||||
} while(0);
|
||||
|
@ -126,19 +126,19 @@ extern wifi_osi_funcs_t s_wifi_osi_funcs;
|
||||
s_wifi_osi_funcs.timer_delete(t, tk)
|
||||
|
||||
#define wifi_malloc(s, c) \
|
||||
s_wifi_osi_funcs.malloc(s, c, __FILE__, __LINE__)
|
||||
s_wifi_osi_funcs.malloc(s, c, __ESP_FILE__, __LINE__)
|
||||
|
||||
#define wifi_zalloc(s, c) \
|
||||
s_wifi_osi_funcs.zalloc(s, c, __FILE__, __LINE__)
|
||||
s_wifi_osi_funcs.zalloc(s, c, __ESP_FILE__, __LINE__)
|
||||
|
||||
#define wifi_calloc(cnt, s, c) \
|
||||
s_wifi_osi_funcs.calloc(cnt, s, c, __FILE__, __LINE__)
|
||||
s_wifi_osi_funcs.calloc(cnt, s, c, __ESP_FILE__, __LINE__)
|
||||
|
||||
#define wifi_realloc(ptr, s, c) \
|
||||
s_wifi_osi_funcs.realloc(ptr, s, c, __FILE__, __LINE__)
|
||||
s_wifi_osi_funcs.realloc(ptr, s, c, __ESP_FILE__, __LINE__)
|
||||
|
||||
#define wifi_free(p) \
|
||||
s_wifi_osi_funcs.free(p, __FILE__, __LINE__)
|
||||
s_wifi_osi_funcs.free(p, __ESP_FILE__, __LINE__)
|
||||
|
||||
#define wifi_get_free_heap_size() \
|
||||
s_wifi_osi_funcs.get_free_heap_size()
|
||||
|
@ -214,7 +214,7 @@ void show_critical_info(void);
|
||||
* @brief add trace information to allocated memory
|
||||
*
|
||||
* @param ptr memory pointer allocated by "os_maloc", "malloc" and so on
|
||||
* @param trace trace information, file name(__FILE__) or "__builtin_return_address(0)" is OK
|
||||
* @param trace trace information, file name(__ESP_FILE__) or "__builtin_return_address(0)" is OK
|
||||
* @param no number of trace information, file line(__LINE__) or -1(using "__builtin_return_address(0)")
|
||||
*/
|
||||
void esp_mem_trace(const void *ptr, const char *trace, int no);
|
||||
@ -224,7 +224,7 @@ void esp_mem_trace(const void *ptr, const char *trace, int no);
|
||||
*
|
||||
* @param ptr memory pointer allocated by "os_maloc", "malloc" and so on
|
||||
*/
|
||||
#define esp_mem_mark_file(ptr) esp_mem_trace((ptr), __FILE__, LINE__)
|
||||
#define esp_mem_mark_file(ptr) esp_mem_trace((ptr), __ESP_FILE__, LINE__)
|
||||
|
||||
/*
|
||||
* @brief check if CPU core interrupt is disable
|
||||
|
@ -121,7 +121,7 @@ void esp_heap_caps_init_region(heap_region_t *region, size_t max_num);
|
||||
*
|
||||
* @return A pointer to the memory allocated on success, NULL on failure
|
||||
*/
|
||||
#define heap_caps_malloc(size, caps) _heap_caps_malloc(size, caps, __FILE__, __LINE__)
|
||||
#define heap_caps_malloc(size, caps) _heap_caps_malloc(size, caps, __ESP_FILE__, __LINE__)
|
||||
|
||||
void *_heap_caps_malloc(size_t size, uint32_t caps, const char *file, size_t line);
|
||||
|
||||
@ -134,7 +134,7 @@ void *_heap_caps_malloc(size_t size, uint32_t caps, const char *file, size_t lin
|
||||
*
|
||||
* @param ptr Pointer to memory previously returned from heap_caps_(m/c/re/z)alloc(). Can be NULL.
|
||||
*/
|
||||
#define heap_caps_free(p) _heap_caps_free(p, __FILE__, __LINE__)
|
||||
#define heap_caps_free(p) _heap_caps_free(p, __ESP_FILE__, __LINE__)
|
||||
|
||||
void _heap_caps_free(void *ptr, const char *file, size_t line);
|
||||
|
||||
@ -151,7 +151,7 @@ void _heap_caps_free(void *ptr, const char *file, size_t line);
|
||||
*
|
||||
* @return A pointer to the memory allocated on success, NULL on failure
|
||||
*/
|
||||
#define heap_caps_calloc(n, size, caps) _heap_caps_calloc(n, size, caps, __FILE__, __LINE__)
|
||||
#define heap_caps_calloc(n, size, caps) _heap_caps_calloc(n, size, caps, __ESP_FILE__, __LINE__)
|
||||
|
||||
void *_heap_caps_calloc(size_t count, size_t size, uint32_t caps, const char *file, size_t line);
|
||||
|
||||
@ -171,7 +171,7 @@ void *_heap_caps_calloc(size_t count, size_t size, uint32_t caps, const char *fi
|
||||
*
|
||||
* @return Pointer to a new buffer of size 'size' with capabilities 'caps', or NULL if allocation failed.
|
||||
*/
|
||||
#define heap_caps_realloc(ptr, size, caps) _heap_caps_realloc(ptr, size, caps, __FILE__, __LINE__)
|
||||
#define heap_caps_realloc(ptr, size, caps) _heap_caps_realloc(ptr, size, caps, __ESP_FILE__, __LINE__)
|
||||
|
||||
void *_heap_caps_realloc(void *mem, size_t newsize, uint32_t caps, const char *file, size_t line);
|
||||
|
||||
@ -188,7 +188,7 @@ void *_heap_caps_realloc(void *mem, size_t newsize, uint32_t caps, const char *f
|
||||
*
|
||||
* @return A pointer to the memory allocated on success, NULL on failure
|
||||
*/
|
||||
#define heap_caps_zalloc(size, caps) _heap_caps_zalloc(size, caps, __FILE__, __LINE__)
|
||||
#define heap_caps_zalloc(size, caps) _heap_caps_zalloc(size, caps, __ESP_FILE__, __LINE__)
|
||||
|
||||
void *_heap_caps_zalloc(size_t size, uint32_t caps, const char *file, size_t line);
|
||||
|
||||
|
@ -88,7 +88,7 @@
|
||||
*/
|
||||
#ifndef LWIP_PLATFORM_ASSERT
|
||||
#define LWIP_PLATFORM_ASSERT(x) do {printf("Assertion \"%s\" failed at line %d in %s\n", \
|
||||
x, __LINE__, __FILE__); fflush(NULL); abort();} while(0)
|
||||
x, __LINE__, __ESP_FILE__); fflush(NULL); abort();} while(0)
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
@ -145,7 +145,7 @@ void memp_init(void);
|
||||
#error "MEMP_OVERFLOW_CHECK && ESP_LWIP_MEM_DBG cannot used"
|
||||
#endif
|
||||
void *memp_malloc_fn(memp_t type, const char* file, const int line);
|
||||
#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__)
|
||||
#define memp_malloc(t) memp_malloc_fn((t), __ESP_FILE__, __LINE__)
|
||||
#else
|
||||
void *memp_malloc(memp_t type);
|
||||
#endif
|
||||
|
@ -173,7 +173,7 @@ void memp_init_pool(const struct memp_desc *desc);
|
||||
#error "MEMP_OVERFLOW_CHECK && ESP_LWIP_MEM_DBG cannot used"
|
||||
#endif
|
||||
void *memp_malloc_pool_fn(const struct memp_desc* desc, const char* file, const int line);
|
||||
#define memp_malloc_pool(d) memp_malloc_pool_fn((d), __FILE__, __LINE__)
|
||||
#define memp_malloc_pool(d) memp_malloc_pool_fn((d), __ESP_FILE__, __LINE__)
|
||||
#else
|
||||
void *memp_malloc_pool(const struct memp_desc *desc);
|
||||
#endif
|
||||
|
@ -66,7 +66,7 @@ typedef int sys_prot_t;
|
||||
extern void sys_arch_assert(const char *file, int line);
|
||||
|
||||
#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)
|
||||
#define LWIP_PLATFORM_ASSERT(x) do {printf(x); sys_arch_assert(__FILE__, __LINE__);} while(0)
|
||||
#define LWIP_PLATFORM_ASSERT(x) do {printf(x); sys_arch_assert(__ESP_FILE__, __LINE__);} while(0)
|
||||
#else
|
||||
#define LWIP_PLATFORM_DIAG(x)
|
||||
#define LWIP_PLATFORM_ASSERT(x)
|
||||
|
@ -13,7 +13,7 @@ extern "C" {
|
||||
#ifdef NDEBUG /* required by ANSI standard */
|
||||
# define assert(__e) ((__e) ? (void)0 : (void)0)
|
||||
#else
|
||||
# define assert(__e) ((__e) ? (void)0 : __assert_func (__FILE__, __LINE__, \
|
||||
# define assert(__e) ((__e) ? (void)0 : __assert_func (__ESP_FILE__, __LINE__, \
|
||||
__ASSERT_FUNC, #__e))
|
||||
|
||||
# ifndef __ASSERT_FUNC
|
||||
|
Reference in New Issue
Block a user