From 282c9ab1e1d109b341137afce8a16dd248d46acf Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 12 May 2022 17:52:18 +0700 Subject: [PATCH 1/2] esp_wifi: make int types consistent --- components/esp_wifi/esp32/esp_adapter.c | 2 +- components/esp_wifi/esp32c3/esp_adapter.c | 8 ++++---- components/esp_wifi/esp32s2/esp_adapter.c | 2 +- components/esp_wifi/esp32s3/esp_adapter.c | 2 +- .../esp_wifi/include/esp_private/wifi_os_adapter.h | 10 +++++----- components/esp_wifi/lib | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/components/esp_wifi/esp32/esp_adapter.c b/components/esp_wifi/esp32/esp_adapter.c index 1309509e2f..7e3ad7cd79 100644 --- a/components/esp_wifi/esp32/esp_adapter.c +++ b/components/esp_wifi/esp32/esp_adapter.c @@ -660,7 +660,7 @@ static void IRAM_ATTR esp_empty_wrapper(void) } -int32_t IRAM_ATTR coex_is_in_isr_wrapper(void) +int IRAM_ATTR coex_is_in_isr_wrapper(void) { return !xPortCanYield(); } diff --git a/components/esp_wifi/esp32c3/esp_adapter.c b/components/esp_wifi/esp32c3/esp_adapter.c index 6ad5db4aff..33c4a4f8a6 100644 --- a/components/esp_wifi/esp32c3/esp_adapter.c +++ b/components/esp_wifi/esp32c3/esp_adapter.c @@ -458,17 +458,17 @@ static void * IRAM_ATTR zalloc_internal_wrapper(size_t size) return ptr; } -static esp_err_t nvs_open_wrapper(const char* name, uint32_t open_mode, nvs_handle_t *out_handle) +static esp_err_t nvs_open_wrapper(const char* name, unsigned int open_mode, nvs_handle_t *out_handle) { return nvs_open(name,(nvs_open_mode_t)open_mode, out_handle); } -static void esp_log_writev_wrapper(uint32_t level, const char *tag, const char *format, va_list args) +static void esp_log_writev_wrapper(unsigned int level, const char *tag, const char *format, va_list args) { return esp_log_writev((esp_log_level_t)level,tag,format,args); } -static void esp_log_write_wrapper(uint32_t level,const char *tag,const char *format, ...) +static void esp_log_write_wrapper(unsigned int level,const char *tag,const char *format, ...) { va_list list; va_start(list, format); @@ -476,7 +476,7 @@ static void esp_log_write_wrapper(uint32_t level,const char *tag,const char *for va_end(list); } -static esp_err_t esp_read_mac_wrapper(uint8_t* mac, uint32_t type) +static esp_err_t esp_read_mac_wrapper(uint8_t* mac, unsigned int type) { return esp_read_mac(mac, (esp_mac_type_t)type); } diff --git a/components/esp_wifi/esp32s2/esp_adapter.c b/components/esp_wifi/esp32s2/esp_adapter.c index f953aa80ed..48b9deeafb 100644 --- a/components/esp_wifi/esp32s2/esp_adapter.c +++ b/components/esp_wifi/esp32s2/esp_adapter.c @@ -663,7 +663,7 @@ static void IRAM_ATTR esp_empty_wrapper(void) } -int32_t IRAM_ATTR coex_is_in_isr_wrapper(void) +int IRAM_ATTR coex_is_in_isr_wrapper(void) { return !xPortCanYield(); } diff --git a/components/esp_wifi/esp32s3/esp_adapter.c b/components/esp_wifi/esp32s3/esp_adapter.c index bec1ab0265..2087e912cf 100644 --- a/components/esp_wifi/esp32s3/esp_adapter.c +++ b/components/esp_wifi/esp32s3/esp_adapter.c @@ -680,7 +680,7 @@ static void IRAM_ATTR esp_empty_wrapper(void) } -int32_t IRAM_ATTR coex_is_in_isr_wrapper(void) +int IRAM_ATTR coex_is_in_isr_wrapper(void) { return !xPortCanYield(); } diff --git a/components/esp_wifi/include/esp_private/wifi_os_adapter.h b/components/esp_wifi/include/esp_private/wifi_os_adapter.h index fa0f152936..acb973c011 100644 --- a/components/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/components/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -66,7 +66,7 @@ typedef struct { int32_t (* _task_ms_to_tick)(uint32_t ms); void *(* _task_get_current_task)(void); int32_t (* _task_get_max_priority)(void); - void *(* _malloc)(unsigned int size); + void *(* _malloc)(size_t size); void (* _free)(void *p); int32_t (* _event_post)(const char* event_base, int32_t event_id, void* event_data, size_t event_data_size, uint32_t ticks_to_wait); uint32_t (* _get_free_heap_size)(void); @@ -82,7 +82,7 @@ typedef struct { void (* _phy_common_clock_disable)(void); #endif int (* _phy_update_country_info)(const char* country); - int (* _read_mac)(uint8_t* mac, uint32_t type); + int (* _read_mac)(uint8_t* mac, unsigned int type); void (* _timer_arm)(void *timer, uint32_t tmout, bool repeat); void (* _timer_disarm)(void *timer); void (* _timer_done)(void *ptimer); @@ -100,7 +100,7 @@ typedef struct { int (* _nvs_get_u8)(uint32_t handle, const char* key, uint8_t* out_value); int (* _nvs_set_u16)(uint32_t handle, const char* key, uint16_t value); int (* _nvs_get_u16)(uint32_t handle, const char* key, uint16_t* out_value); - int (* _nvs_open)(const char* name, uint32_t open_mode, uint32_t *out_handle); + int (* _nvs_open)(const char* name, unsigned int open_mode, uint32_t *out_handle); void (* _nvs_close)(uint32_t handle); int (* _nvs_commit)(uint32_t handle); int (* _nvs_set_blob)(uint32_t handle, const char* key, const void* value, size_t length); @@ -112,8 +112,8 @@ typedef struct { #if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C2 uint32_t (* _slowclk_cal_get)(void); #endif - void (* _log_write)(uint32_t level, const char* tag, const char* format, ...); - void (* _log_writev)(uint32_t level, const char* tag, const char* format, va_list args); + void (* _log_write)(unsigned int level, const char* tag, const char* format, ...); + void (* _log_writev)(unsigned int level, const char* tag, const char* format, va_list args); uint32_t (* _log_timestamp)(void); void * (* _malloc_internal)(size_t size); void * (* _realloc_internal)(void *ptr, size_t size); diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index 05794b1c88..0d5920de95 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit 05794b1c8898c9b43bd8c1b3418dea0f140ec303 +Subproject commit 0d5920de9592ae63ecb40471e895931fee2b0a66 From 47909a76c047c232c2ce4adaf4d80c2910cc6726 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 29 May 2022 18:59:13 +0800 Subject: [PATCH 2/2] esp_wifi: make int types consistent for esp32c2 --- components/esp_wifi/esp32c2/esp_adapter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/esp_wifi/esp32c2/esp_adapter.c b/components/esp_wifi/esp32c2/esp_adapter.c index ee3dc062ee..5fa204d1d2 100644 --- a/components/esp_wifi/esp32c2/esp_adapter.c +++ b/components/esp_wifi/esp32c2/esp_adapter.c @@ -458,17 +458,17 @@ static void * IRAM_ATTR zalloc_internal_wrapper(size_t size) return ptr; } -static esp_err_t nvs_open_wrapper(const char* name, uint32_t open_mode, nvs_handle_t *out_handle) +static esp_err_t nvs_open_wrapper(const char* name, unsigned int open_mode, nvs_handle_t *out_handle) { return nvs_open(name,(nvs_open_mode_t)open_mode, out_handle); } -static void esp_log_writev_wrapper(uint32_t level, const char *tag, const char *format, va_list args) +static void esp_log_writev_wrapper(unsigned int level, const char *tag, const char *format, va_list args) { return esp_log_writev((esp_log_level_t)level,tag,format,args); } -static void esp_log_write_wrapper(uint32_t level,const char *tag,const char *format, ...) +static void esp_log_write_wrapper(unsigned int level,const char *tag,const char *format, ...) { va_list list; va_start(list, format); @@ -476,7 +476,7 @@ static void esp_log_write_wrapper(uint32_t level,const char *tag,const char *for va_end(list); } -static esp_err_t esp_read_mac_wrapper(uint8_t* mac, uint32_t type) +static esp_err_t esp_read_mac_wrapper(uint8_t* mac, unsigned int type) { return esp_read_mac(mac, (esp_mac_type_t)type); }