You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ma...@apache.org on 2021/01/27 22:51:42 UTC

[incubator-nuttx] branch master updated: esp32/esp32_wifi_adapter.c: Print debug output only when DEBUG_WIRLESS* are enabled.

This is an automated email from the ASF dual-hosted git repository.

masayuki pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 82aae4d  esp32/esp32_wifi_adapter.c: Print debug output only when DEBUG_WIRLESS* are enabled.
82aae4d is described below

commit 82aae4deb69aeeda0cd1cad25cee0d5ecd5c9c3d
Author: Abdelatif Guettouche <ab...@espressif.com>
AuthorDate: Wed Jan 27 14:27:49 2021 +0100

    esp32/esp32_wifi_adapter.c: Print debug output only when DEBUG_WIRLESS*
    are enabled.
    
    Signed-off-by: Abdelatif Guettouche <ab...@espressif.com>
---
 arch/xtensa/src/esp32/esp32_wifi_adapter.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/xtensa/src/esp32/esp32_wifi_adapter.c b/arch/xtensa/src/esp32/esp32_wifi_adapter.c
index b7abaa1..16285e6 100644
--- a/arch/xtensa/src/esp32/esp32_wifi_adapter.c
+++ b/arch/xtensa/src/esp32/esp32_wifi_adapter.c
@@ -3343,25 +3343,27 @@ static uint32_t esp_rand(void)
 static void esp_log_writev(uint32_t level, const char *tag,
                            const char *format, va_list args)
 {
-  int pri;
-
   switch (level)
     {
+#ifdef CONFIG_DEBUG_WIRELESS_ERROR
       case ESP_LOG_ERROR:
-        pri = LOG_ERR;
+        vsyslog(LOG_ERR, format, args);
         break;
+#endif
+#ifdef CONFIG_DEBUG_WIRELESS_WARN
       case ESP_LOG_WARN:
-        pri = LOG_WARNING;
+        vsyslog(LOG_WARNING, format, args);
         break;
+#endif
+#ifdef CONFIG_DEBUG_WIRELESS_INFO
       case ESP_LOG_INFO:
-        pri = LOG_INFO;
+        vsyslog(LOG_INFO, format, args);
         break;
       default:
-        pri = LOG_DEBUG;
+        vsyslog(LOG_DEBUG, format, args);
         break;
+#endif
     }
-
-  vsyslog(pri, format, args);
 }
 
 /****************************************************************************
@@ -3993,11 +3995,13 @@ int phy_printf(const char *format, ...)
 
 int net80211_printf(const char *format, ...)
 {
+#ifdef CONFIG_DEBUG_WIRELESS_INFO
   va_list arg;
 
   va_start(arg, format);
   vsyslog(LOG_INFO, format, arg);
   va_end(arg);
+#endif
 
   return 0;
 }