mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
fix(wifi): Run tools/format.sh on WiFi component
This commit is contained in:
@@ -65,10 +65,10 @@ extern void wifi_apb80m_release(void);
|
||||
If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly.
|
||||
If failed, try to allocate it in internal memory then.
|
||||
*/
|
||||
IRAM_ATTR void *wifi_malloc( size_t size )
|
||||
IRAM_ATTR void *wifi_malloc(size_t size)
|
||||
{
|
||||
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
|
||||
return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
|
||||
return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL);
|
||||
#else
|
||||
return malloc(size);
|
||||
#endif
|
||||
@@ -78,10 +78,10 @@ IRAM_ATTR void *wifi_malloc( size_t size )
|
||||
If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly.
|
||||
If failed, try to allocate it in internal memory then.
|
||||
*/
|
||||
IRAM_ATTR void *wifi_realloc( void *ptr, size_t size )
|
||||
IRAM_ATTR void *wifi_realloc(void *ptr, size_t size)
|
||||
{
|
||||
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
|
||||
return heap_caps_realloc_prefer(ptr, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
|
||||
return heap_caps_realloc_prefer(ptr, size, 2, MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL);
|
||||
#else
|
||||
return realloc(ptr, size);
|
||||
#endif
|
||||
@@ -91,10 +91,10 @@ IRAM_ATTR void *wifi_realloc( void *ptr, size_t size )
|
||||
If CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is enabled. Prefer to allocate a chunk of memory in SPIRAM firstly.
|
||||
If failed, try to allocate it in internal memory then.
|
||||
*/
|
||||
IRAM_ATTR void *wifi_calloc( size_t n, size_t size )
|
||||
IRAM_ATTR void *wifi_calloc(size_t n, size_t size)
|
||||
{
|
||||
#if CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
|
||||
return heap_caps_calloc_prefer(n, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
|
||||
return heap_caps_calloc_prefer(n, size, 2, MALLOC_CAP_DEFAULT | MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT | MALLOC_CAP_INTERNAL);
|
||||
#else
|
||||
return calloc(n, size);
|
||||
#endif
|
||||
@@ -106,11 +106,11 @@ static void * IRAM_ATTR wifi_zalloc_wrapper(size_t size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
wifi_static_queue_t* wifi_create_queue( int queue_len, int item_size)
|
||||
wifi_static_queue_t* wifi_create_queue(int queue_len, int item_size)
|
||||
{
|
||||
wifi_static_queue_t *queue = NULL;
|
||||
|
||||
queue = (wifi_static_queue_t*)heap_caps_malloc(sizeof(wifi_static_queue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
|
||||
queue = (wifi_static_queue_t*)heap_caps_malloc(sizeof(wifi_static_queue_t), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||
if (!queue) {
|
||||
return NULL;
|
||||
}
|
||||
@@ -118,12 +118,12 @@ wifi_static_queue_t* wifi_create_queue( int queue_len, int item_size)
|
||||
#if CONFIG_SPIRAM_USE_MALLOC
|
||||
/* Wi-Fi still use internal RAM */
|
||||
|
||||
queue->storage = heap_caps_calloc(1, sizeof(StaticQueue_t) + (queue_len*item_size), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
|
||||
queue->storage = heap_caps_calloc(1, sizeof(StaticQueue_t) + (queue_len * item_size), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||
if (!queue->storage) {
|
||||
goto _error;
|
||||
}
|
||||
|
||||
queue->handle = xQueueCreateStatic( queue_len, item_size, ((uint8_t*)(queue->storage)) + sizeof(StaticQueue_t), (StaticQueue_t*)(queue->storage));
|
||||
queue->handle = xQueueCreateStatic(queue_len, item_size, ((uint8_t*)(queue->storage)) + sizeof(StaticQueue_t), (StaticQueue_t*)(queue->storage));
|
||||
|
||||
if (!queue->handle) {
|
||||
goto _error;
|
||||
@@ -142,7 +142,7 @@ _error:
|
||||
|
||||
return NULL;
|
||||
#else
|
||||
queue->handle = xQueueCreate( queue_len, item_size);
|
||||
queue->handle = xQueueCreate(queue_len, item_size);
|
||||
return queue;
|
||||
#endif
|
||||
}
|
||||
@@ -413,17 +413,17 @@ static int get_time_wrapper(void *t)
|
||||
|
||||
static void * IRAM_ATTR realloc_internal_wrapper(void *ptr, size_t size)
|
||||
{
|
||||
return heap_caps_realloc(ptr, size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
|
||||
return heap_caps_realloc(ptr, size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
|
||||
}
|
||||
|
||||
static void * IRAM_ATTR calloc_internal_wrapper(size_t n, size_t size)
|
||||
{
|
||||
return heap_caps_calloc(n, size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
|
||||
return heap_caps_calloc(n, size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
|
||||
}
|
||||
|
||||
static void * IRAM_ATTR zalloc_internal_wrapper(size_t size)
|
||||
{
|
||||
void *ptr = heap_caps_calloc(1, size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
|
||||
void *ptr = heap_caps_calloc(1, size, MALLOC_CAP_8BIT | MALLOC_CAP_DMA | MALLOC_CAP_INTERNAL);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -595,7 +595,6 @@ static void IRAM_ATTR esp_empty_wrapper(void)
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void esp_phy_enable_wrapper(void)
|
||||
{
|
||||
esp_phy_enable(PHY_MODEM_WIFI);
|
||||
@@ -642,8 +641,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
|
||||
._queue_msg_waiting = (uint32_t(*)(void *))uxQueueMessagesWaiting,
|
||||
._event_group_create = (void *(*)(void))xEventGroupCreate,
|
||||
._event_group_delete = (void(*)(void *))vEventGroupDelete,
|
||||
._event_group_set_bits = (uint32_t(*)(void *,uint32_t))xEventGroupSetBits,
|
||||
._event_group_clear_bits = (uint32_t(*)(void *,uint32_t))xEventGroupClearBits,
|
||||
._event_group_set_bits = (uint32_t(*)(void *, uint32_t))xEventGroupSetBits,
|
||||
._event_group_clear_bits = (uint32_t(*)(void *, uint32_t))xEventGroupClearBits,
|
||||
._event_group_wait_bits = event_group_wait_bits_wrapper,
|
||||
._task_create_pinned_to_core = task_create_pinned_to_core_wrapper,
|
||||
._task_create = task_create_wrapper,
|
||||
|
Reference in New Issue
Block a user