From 4af1da0f21810fff008f0af2ee94aeb96dbc9d73 Mon Sep 17 00:00:00 2001 From: Christoph Rackwitz Date: Mon, 25 Oct 2021 12:15:30 +0200 Subject: [PATCH] esp_wifi: Reset event bits in ftm example to avoid repeated failures Closes https://github.com/espressif/esp-idf/pull/7773 --- examples/wifi/ftm/main/ftm_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/wifi/ftm/main/ftm_main.c b/examples/wifi/ftm/main/ftm_main.c index 446329e19a..1090f6476c 100644 --- a/examples/wifi/ftm/main/ftm_main.c +++ b/examples/wifi/ftm/main/ftm_main.c @@ -476,7 +476,7 @@ static int wifi_cmd_ftm(int argc, char **argv) } bits = xEventGroupWaitBits(ftm_event_group, FTM_REPORT_BIT | FTM_FAILURE_BIT, - pdFALSE, pdFALSE, portMAX_DELAY); + pdTRUE, pdFALSE, portMAX_DELAY); /* Processing data from FTM session */ if (bits & FTM_REPORT_BIT) { ftm_process_report(); @@ -485,7 +485,6 @@ static int wifi_cmd_ftm(int argc, char **argv) g_ftm_report_num_entries = 0; ESP_LOGI(TAG_STA, "Estimated RTT - %d nSec, Estimated Distance - %d.%02d meters", g_rtt_est, g_dist_est / 100, g_dist_est % 100); - xEventGroupClearBits(ftm_event_group, FTM_REPORT_BIT); } else { /* Failure case */ }