From 49435000580fb05b4c36240e52485e05c6d67891 Mon Sep 17 00:00:00 2001 From: zhangyanjiao Date: Wed, 13 Nov 2019 18:01:41 +0800 Subject: [PATCH] espnow: fix the bug for calling esp_wifi_set_channel(), this function only can be called after Wi-Fi started and sniffer enabled. --- examples/wifi/espnow/main/espnow_example_main.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/examples/wifi/espnow/main/espnow_example_main.c b/examples/wifi/espnow/main/espnow_example_main.c index afb1428c5..e1f52e765 100644 --- a/examples/wifi/espnow/main/espnow_example_main.c +++ b/examples/wifi/espnow/main/espnow_example_main.c @@ -61,12 +61,6 @@ static void example_wifi_init(void) ESP_ERROR_CHECK( esp_wifi_set_storage(WIFI_STORAGE_RAM) ); ESP_ERROR_CHECK( esp_wifi_set_mode(ESPNOW_WIFI_MODE) ); ESP_ERROR_CHECK( esp_wifi_start()); - - /* In order to simplify example, channel is set after WiFi started. - * This is not necessary in real application if the two devices have - * been already on the same channel. - */ - ESP_ERROR_CHECK( esp_wifi_set_channel(CONFIG_ESPNOW_CHANNEL, 0) ); } /* ESPNOW sending or receiving callback function is called in WiFi task.