mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
espnow: fix the bug for calling esp_wifi_set_channel(), this function only can be called after Wi-Fi started and sniffer enabled.
This commit is contained in:
parent
99ab26ac32
commit
6ce1bea29a
@ -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_storage(WIFI_STORAGE_RAM) );
|
||||||
ESP_ERROR_CHECK( esp_wifi_set_mode(ESPNOW_WIFI_MODE) );
|
ESP_ERROR_CHECK( esp_wifi_set_mode(ESPNOW_WIFI_MODE) );
|
||||||
ESP_ERROR_CHECK( esp_wifi_start());
|
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.
|
/* ESPNOW sending or receiving callback function is called in WiFi task.
|
||||||
|
Loading…
Reference in New Issue
Block a user