Skip to content

Commit 04cc474

Browse files
ankohuuxiaoxiang781216
authored andcommitted
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>
1 parent 7141f48 commit 04cc474

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

arch/xtensa/src/common/espressif/esp_wifi_event_handler.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,19 @@ static void esp_evt_work_cb(void *arg)
205205
break;
206206

207207
case WIFI_EVENT_STA_DISCONNECTED:
208-
wifi_event_sta_disconnected_t *event =
209-
(wifi_event_sta_disconnected_t *)evt_adpt->buf;
210-
wifi_err_reason_t reason = event->reason;
211-
212-
wlinfo("Wi-Fi station disconnected, reason: %u\n", reason);
213-
esp_wlan_sta_disconnect_hook();
214-
if (reason == WIFI_REASON_ASSOC_LEAVE)
215-
{
216-
work_queue(LPWORK, &g_wifi_evt_work, esp_reconnect_work_cb,
217-
NULL, 0);
218-
}
208+
{
209+
wifi_event_sta_disconnected_t *event =
210+
(wifi_event_sta_disconnected_t *)evt_adpt->buf;
211+
wifi_err_reason_t reason = event->reason;
212+
213+
wlinfo("Wi-Fi station disconnected, reason: %u\n", reason);
214+
esp_wlan_sta_disconnect_hook();
215+
if (reason == WIFI_REASON_ASSOC_LEAVE)
216+
{
217+
work_queue(LPWORK, &g_wifi_evt_work, esp_reconnect_work_cb,
218+
NULL, 0);
219+
}
220+
}
219221

220222
break;
221223

0 commit comments

Comments
 (0)