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 <ankohuu@gmail.com>
This commit is contained in:
Shunchao Hu
2026-04-21 07:18:29 +08:00
committed by Xiang Xiao
parent 7141f487c0
commit 04cc4740ea
@@ -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;
{
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);
}
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;