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

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


The following commit(s) were added to refs/heads/master by this push:
     new 04cc4740ea3 arch/xtensa: Scope Wi-Fi disconnect case declarations.
04cc4740ea3 is described below

commit 04cc4740ea398673b9e3318f8da2f24a39852b6b
Author: Shunchao Hu <[email protected]>
AuthorDate: Tue Apr 21 07:18:29 2026 +0800

    arch/xtensa: Scope Wi-Fi disconnect case declarations.
    
    - fix a "a label can only be part of a statement and
      a declaration is not a statement" compile error.
    - toolchain xtensa-esp32s3-elf-gcc
      (crosstool-NG esp-2021r2) 8.4.0
    
    Signed-off-by: Shunchao Hu <[email protected]>
---
 .../src/common/espressif/esp_wifi_event_handler.c  | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/arch/xtensa/src/common/espressif/esp_wifi_event_handler.c 
b/arch/xtensa/src/common/espressif/esp_wifi_event_handler.c
index 77a8f129dde..6148d36d9ff 100644
--- a/arch/xtensa/src/common/espressif/esp_wifi_event_handler.c
+++ b/arch/xtensa/src/common/espressif/esp_wifi_event_handler.c
@@ -205,17 +205,19 @@ static void esp_evt_work_cb(void *arg)
             break;
 
           case WIFI_EVENT_STA_DISCONNECTED:
-            wifi_event_sta_disconnected_t *event =
-              (wifi_event_sta_disconnected_t *)evt_adpt->buf;
-            wifi_err_reason_t reason = event->reason;
-
-            wlinfo("Wi-Fi station disconnected, reason: %u\n", reason);
-            esp_wlan_sta_disconnect_hook();
-            if (reason == WIFI_REASON_ASSOC_LEAVE)
-              {
-                work_queue(LPWORK, &g_wifi_evt_work, esp_reconnect_work_cb,
-                           NULL, 0);
-              }
+            {
+              wifi_event_sta_disconnected_t *event =
+                (wifi_event_sta_disconnected_t *)evt_adpt->buf;
+              wifi_err_reason_t reason = event->reason;
+
+              wlinfo("Wi-Fi station disconnected, reason: %u\n", reason);
+              esp_wlan_sta_disconnect_hook();
+              if (reason == WIFI_REASON_ASSOC_LEAVE)
+                {
+                  work_queue(LPWORK, &g_wifi_evt_work, esp_reconnect_work_cb,
+                             NULL, 0);
+                }
+            }
 
             break;
 

Reply via email to