8000 esp32/esp8266: Rename WLAN.PM_* constants. · micropython/micropython@4f56f71 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f56f71

Browse files
committed
esp32/esp8266: Rename WLAN.PM_* constants.
Adopt new names for PM_ constants: - PM_PERFORMANCE, PM_POWERSAVE, PM_NONE.
1 parent 03bd089 commit 4f56f71

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

docs/library/network.WLAN.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,14 @@ Methods
139139
Constants
140140
---------
141141

142-
.. data:: WLAN.PM_NONE
143-
WLAN.PM_MIN_MODEM
144-
WLAN.PM_MAX_MODEM
145-
WLAN.PM_LIGHT_SLEEP (``esp8266 only``)
146-
147-
Allowed values for the ``WLAN.config(pm=...)`` network interface parameter.
148-
``PM_NONE``, ``PM_MIN_MODEM`` and ``PM_MAX_MODEM`` are supported on the
149-
esp32 and esp8266 ports. ``PM_LIGHT_SLEEP`` is supported on the esp8266
150-
port.
142+
.. data:: WLAN.PM_PERFORMANCE
143+
WLAN.PM_POWERSAVE
144+
WLAN.PM_NONE
145+
146+
Allowed values for the ``WLAN.config(pm=...)`` network interface parameter:
147+
148+
* ``PM_PERFORMANCE``: enable WiFi power management to balance power
149+
savings and WiFi performance
150+
* ``PM_POWERSAVE``: enable WiFi power management with additional power
151+
savings and reduced WiFi performance
152+
* ``PM_NONE``: disable wifi power management

ports/esp32/network_wlan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,8 @@ STATIC const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
640640

641641
// Constants
642642
{ MP_ROM_QSTR(MP_QSTR_PM_NONE), MP_ROM_INT(WIFI_PS_NONE) },
643-
{ MP_ROM_QSTR(MP_QSTR_PM_MIN_MODEM), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
644-
{ MP_ROM_QSTR(MP_QSTR_PM_MAX_MODEM), MP_ROM_INT(WIFI_PS_MAX_MODEM) },
643+
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
644+
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(WIFI_PS_MAX_MODEM) },
645645
};
646646
STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);
647647

ports/esp8266/network_wlan.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,8 @@ STATIC const mp_rom_map_elem_t wlan_if_locals_dict_table[] = {
522522

523523
// Constants
524524
{ MP_ROM_QSTR(MP_QSTR_PM_NONE), MP_ROM_INT(NONE_SLEEP_T) },
525-
{ MP_ROM_QSTR(MP_QSTR_PM_MIN_MODEM), MP_ROM_INT(MODEM_SLEEP_T) },
526-
{ MP_ROM_QSTR(MP_QSTR_PM_MAX_MODEM), MP_ROM_INT(MODEM_SLEEP_T) },
527-
{ MP_ROM_QSTR(MP_QSTR_PM_LIGHT_SLEEP), MP_ROM_INT(LIGHT_SLEEP_T) },
525+
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(MODEM_SLEEP_T) },
526+
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(LIGHT_SLEEP_T) },
528527
};
529528

530529
STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);

0 commit comments

Comments
 (0)
0