From e30e543a7559f1235637a54ef2b0b4feb196c44d Mon Sep 17 00:00:00 2001 From: Antonello Margottini Date: Wed, 4 Jan 2023 11:36:54 +0100 Subject: [PATCH] esp8266/modnetwork: Add ability to set tx power for WLAN interface. --- ports/esp8266/modnetwork.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ports/esp8266/modnetwork.c b/ports/esp8266/modnetwork.c index ec62528a08..29bdd3a1b7 100644 --- a/ports/esp8266/modnetwork.c +++ b/ports/esp8266/modnetwork.c @@ -410,6 +410,11 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs wifi_set_phy_mode(mp_obj_get_int(kwargs->table[i].value)); break; } + case MP_QSTR_txpower: { + int8_t power = mp_obj_get_float(kwargs->table[i].value) * 4; + system_phy_set_max_tpw(power); + break; + } default: goto unknown; }