esp8266/modnetwork: Add ability to set tx power for WLAN interface.

This commit is contained in:
Antonello Margottini 2023-01-04 11:36:54 +01:00 committed by Damien George
parent fb0dd86b39
commit e30e543a75
1 changed files with 5 additions and 0 deletions

View File

@ -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;
}