Forráskód Böngészése

Merge branch 'bugfix/reduce_wifi_bin_size' into 'master'

esp_wifi: Reduce Bin size

Closes WIFI-9

See merge request espressif/esp-idf!7781
Jiang Jiang Jian 5 éve
szülő
commit
ad7dfb77c4

+ 1 - 0
components/esp_wifi/esp32/esp_adapter.c

@@ -616,6 +616,7 @@ wifi_osi_funcs_t g_wifi_osi_funcs = {
     ._get_time = get_time_wrapper,
     ._random = os_random,
     ._log_write = esp_log_write,
+    ._log_writev = esp_log_writev,
     ._log_timestamp = esp_log_timestamp,
     ._malloc_internal =  malloc_internal_wrapper,
     ._realloc_internal = realloc_internal_wrapper,

+ 1 - 0
components/esp_wifi/include/esp_private/wifi_os_adapter.h

@@ -113,6 +113,7 @@ typedef struct {
     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);
     uint32_t (* _log_timestamp)(void);
     void * (* _malloc_internal)(size_t size);
     void * (* _realloc_internal)(void *ptr, size_t size);

+ 1 - 1
components/esp_wifi/include/esp_wifi_types.h

@@ -217,7 +217,7 @@ typedef struct {
     uint8_t channel;            /**< Channel of ESP32 soft-AP */
     wifi_auth_mode_t authmode;  /**< Auth mode of ESP32 soft-AP. Do not support AUTH_WEP in soft-AP mode */
     uint8_t ssid_hidden;        /**< Broadcast SSID or not, default 0, broadcast the SSID */
-    uint8_t max_connection;     /**< Max number of stations allowed to connect in, default 4, max 4 */
+    uint8_t max_connection;     /**< Max number of stations allowed to connect in, default 4, max 10 */
     uint16_t beacon_interval;   /**< Beacon interval, 100 ~ 60000 ms, default 100 ms */
 } wifi_ap_config_t;
 

+ 1 - 1
components/esp_wifi/lib

@@ -1 +1 @@
-Subproject commit 662585ad48bbcad01b757fab63ba9adbb0020f57
+Subproject commit f0b17693e953c084ceb9f8ce0dfced2c0daf6b4c

+ 9 - 0
components/log/include/esp_log.h

@@ -125,6 +125,15 @@ uint32_t esp_log_early_timestamp(void);
  */
 void esp_log_write(esp_log_level_t level, const char* tag, const char* format, ...) __attribute__ ((format (printf, 3, 4)));
 
+/**
+ * @brief Write message into the log, va_list variant
+ * @see esp_log_write()
+ *
+ * This function is provided to ease integration toward other logging framework,
+ * so that esp_log can be used as a log sink.
+ */
+void esp_log_writev(esp_log_level_t level, const char* tag, const char* format, va_list args);
+
 /** @cond */
 
 #include "esp_log_internal.h"

+ 12 - 3
components/log/log.c

@@ -162,9 +162,10 @@ void clear_log_level_list(void)
 #endif
 }
 
-void esp_log_write(esp_log_level_t level,
+void esp_log_writev(esp_log_level_t level,
                    const char *tag,
-                   const char *format, ...)
+                   const char *format,
+                   va_list args)
 {
     if (!esp_log_impl_lock_timeout()) {
         return;
@@ -185,9 +186,17 @@ void esp_log_write(esp_log_level_t level,
         return;
     }
 
+    (*s_log_print_func)(format, args);
+
+}
+
+void esp_log_write(esp_log_level_t level,
+                   const char *tag,
+                   const char *format, ...)
+{
     va_list list;
     va_start(list, format);
-    (*s_log_print_func)(format, list);
+    esp_log_writev(level, tag, format, list);
     va_end(list);
 }