From df5f3c16815a51d237718b8e6b22d544731ffdbc Mon Sep 17 00:00:00 2001 From: Glenn Moloney Date: Mon, 26 Jun 2023 18:05:37 +1000 Subject: [PATCH] esp8266: WLAN.config(channel=x) to use wifi_set_channel(). Also permits channel option to be used for STA_IF interface. This provides compatibility with ESP32 code (esp. for espnow users). Signed-off-by: Glenn Moloney --- ports/esp8266/network_wlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp8266/network_wlan.c b/ports/esp8266/network_wlan.c index 8b5f4c464b..d55babeac6 100644 --- a/ports/esp8266/network_wlan.c +++ b/ports/esp8266/network_wlan.c @@ -395,8 +395,8 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs break; } case MP_QSTR_channel: { - req_if = SOFTAP_IF; cfg.ap.channel = mp_obj_get_int(kwargs->table[i].value); + error_check(wifi_set_channel(cfg.ap.channel), "can't set channel"); break; } case MP_QSTR_hostname: