Skip to content

Commit 9cced64

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 9cced64

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

docs/library/network.WLAN.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,13 @@ 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``: high performance wifi with higher power consumption
149+
* ``PM_POWERSAVE``: reduce wifi power consumption with reduced
150+
performance
151+
* ``PM_NONE``: disable wifi power management

ports/esp32/network_wlan.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,8 +640,9 @@ 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_DEFAULT), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
644+
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(WIFI_PS_MIN_MODEM) },
645+
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(WIFI_PS_MAX_MODEM) },
645646
};
646647
STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);
647648

ports/esp8266/network_wlan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,9 @@ 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_DEFAULT), MP_ROM_INT(MODEM_SLEEP_T) },
526+
{ MP_ROM_QSTR(MP_QSTR_PM_PERFORMANCE), MP_ROM_INT(MODEM_SLEEP_T) },
527+
{ MP_ROM_QSTR(MP_QSTR_PM_POWERSAVE), MP_ROM_INT(LIGHT_SLEEP_T) },
528528
};
529529

530530
STATIC MP_DEFINE_CONST_DICT(wlan_if_locals_dict, wlan_if_locals_dict_table);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy