From 7c9109d9e1e972276fff01c398a7a2771216c248 Mon Sep 17 00:00:00 2001 From: xuxiao Date: Fri, 23 Aug 2024 19:11:34 +0800 Subject: [PATCH] fix(wifi): fix code comments --- components/esp_phy/CMakeLists.txt | 2 +- components/esp_phy/esp32c61/phy_init_data.c | 4 +-- .../include/local/esp_wifi_types_native.h | 2 +- components/esp_wifi/lib | 2 +- .../low-power-mode/low-power-mode-wifi.rst | 32 +++++++++--------- .../low-power-mode/low-power-mode-wifi.rst | 33 ++++++++++--------- examples/openthread/.build-test-rules.yml | 2 +- examples/openthread/ot_br/README.md | 6 ++-- 8 files changed, 42 insertions(+), 41 deletions(-) diff --git a/components/esp_phy/CMakeLists.txt b/components/esp_phy/CMakeLists.txt index 6035e3067dd..d8a75f17963 100644 --- a/components/esp_phy/CMakeLists.txt +++ b/components/esp_phy/CMakeLists.txt @@ -5,7 +5,7 @@ if(${idf_target} STREQUAL "linux") endif() if(IDF_TARGET STREQUAL "esp32p4") - # TODO: IDF-7460, IDF-8851, IDF-9553 + # TODO: IDF-7460 idf_component_register() return() endif() diff --git a/components/esp_phy/esp32c61/phy_init_data.c b/components/esp_phy/esp32c61/phy_init_data.c index 9bb8099d8b7..80143152568 100644 --- a/components/esp_phy/esp32c61/phy_init_data.c +++ b/components/esp_phy/esp32c61/phy_init_data.c @@ -14,7 +14,7 @@ const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY_INIT_M * @brief Structure containing default recommended PHY initialization parameters. */ const esp_phy_init_data_t phy_init_data= { { -0x1, + 0x1, 0x0, LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), LIMIT(CONFIG_ESP_PHY_MAX_TX_POWER * 4, 0, 0x50), @@ -96,7 +96,7 @@ const esp_phy_init_data_t phy_init_data= { { 0, 0, 0, - 0, + 0, 0, 0, 0, diff --git a/components/esp_wifi/include/local/esp_wifi_types_native.h b/components/esp_wifi/include/local/esp_wifi_types_native.h index 20f85a38998..3efc979daad 100644 --- a/components/esp_wifi/include/local/esp_wifi_types_native.h +++ b/components/esp_wifi/include/local/esp_wifi_types_native.h @@ -19,7 +19,7 @@ extern "C" { #if CONFIG_IDF_TARGET_ESP32C2 #define ESP_WIFI_MAX_CONN_NUM (4) /**< max number of stations which can connect to ESP32C2 soft-AP */ #elif CONFIG_IDF_TARGET_ESP32C3 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C5 || CONFIG_IDF_TARGET_ESP32C61 -#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3 soft-AP */ +#define ESP_WIFI_MAX_CONN_NUM (10) /**< max number of stations which can connect to ESP32C3/ESP32C6/ESP32C5/ESP32C61 soft-AP */ #else #define ESP_WIFI_MAX_CONN_NUM (15) /**< max number of stations which can connect to ESP32/ESP32S3/ESP32S2 soft-AP */ #endif diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index f28ad22ab85..e66a47c0ba3 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit f28ad22ab853677d8b0d398abe89babe274c222f +Subproject commit e66a47c0ba36a6cf4edfe0dbf4d21588d07b374e diff --git a/docs/en/api-guides/low-power-mode/low-power-mode-wifi.rst b/docs/en/api-guides/low-power-mode/low-power-mode-wifi.rst index 208b6c1df26..1f3b710d4c4 100644 --- a/docs/en/api-guides/low-power-mode/low-power-mode-wifi.rst +++ b/docs/en/api-guides/low-power-mode/low-power-mode-wifi.rst @@ -5,18 +5,18 @@ Introduction to Low Power Mode in Wi-Fi Scenarios After the previous introduction to low power mode from a systemic perspective, this section delves into low power mode in Wi-Fi scenarios. Due to the complexity of Wi-Fi scenarios, basic principles of Wi-Fi power saving will be introduced before specific low power mode. This section is focused on station mode. -Choosing Low Power Mode in Wi-Fi Scenarios ---------------------------------------------- +.. todo - add sleep-current/esp32c5_summary.inc and sleep-current/esp32c61_summary.inc -To help users select appropriate low power mode, a summary table of low power modes in Wi-Fi scenarios is provided before detailed introduction. +.. only:: not esp32c5 and not esp32c61 -.. todo - add sleep-current/esp32c5_summary.inc + Choosing Low Power Mode in Wi-Fi Scenarios + --------------------------------------------- -.. only:: not esp32c5 and not esp32c61 + To help users select appropriate low power mode, a summary table of low power modes in Wi-Fi scenarios is provided before detailed introduction. - .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_summary.inc + .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_summary.inc -.. note:: + .. note:: All currents in the table are average currents, and the terms in the table are explained in the following text. Users can refer to them as needed. @@ -363,13 +363,13 @@ Modem-sleep Mode Configuration * - ``light_sleep_enable`` - false -- Configuration Performance + .. todo - add sleep-current/esp32c5_modem_sleep.inc sleep-current/esp32c61_modem_sleep.inc - .. todo - add sleep-current/esp32c5_modem_sleep.inc + .. only:: not esp32c5 and not esp32c61 - .. only:: not esp32c5 and not esp32c61 + - Configuration Performance - .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_modem_sleep.inc + .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_modem_sleep.inc Auto Light-sleep Mode + Wi-Fi Scenario Configuration @@ -377,15 +377,15 @@ Auto Light-sleep Mode + Wi-Fi Scenario Configuration Auto Light-sleep mode in Wi-Fi scenarios does not require wake-up source configuration compared with a pure system. But the remaining part of configuration is basically the same in the two operation scenarios. Therefore, detailed introduction of configurable options, configuration steps, and recommended configurations can be found in the previous section :ref:`Deep-sleep Mode`, with the Wi-Fi-related configurations set to default. -- Configuration Performance +.. todo - add sleep-current/esp32c5_light_sleep.inc and leep-current/esp32c61_light_sleep.inc - The configuration performance mirrors that of the recommended Auto Light-sleep mode configuration in a pure system, combined with the default Wi-Fi-related configurations in the Wi-Fi environment. +.. only:: not esp32c5 and not esp32c61 - .. todo - add sleep-current/esp32c5_light_sleep.inc + - Configuration Performance - .. only:: not esp32c5 and not esp32c61 + The configuration performance mirrors that of the recommended Auto Light-sleep mode configuration in a pure system, combined with the default Wi-Fi-related configurations in the Wi-Fi environment. - .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_light_sleep.inc + .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_light_sleep.inc Deep-sleep Mode + Wi-Fi Scenario Configuration ++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/docs/zh_CN/api-guides/low-power-mode/low-power-mode-wifi.rst b/docs/zh_CN/api-guides/low-power-mode/low-power-mode-wifi.rst index 40a8f0625bf..ac6af18ba32 100644 --- a/docs/zh_CN/api-guides/low-power-mode/low-power-mode-wifi.rst +++ b/docs/zh_CN/api-guides/low-power-mode/low-power-mode-wifi.rst @@ -5,18 +5,19 @@ Wi-Fi 场景下低功耗模式介绍 本节将结合纯系统下的功耗模式来介绍 Wi-Fi 场景下的低功耗模式。因为 Wi-Fi 场景的复杂性,本节会首先介绍 Wi-Fi 省电的基本原理,然后再介绍具体的低功耗模式。本节主要针对 station 模式。 -Wi-Fi 场景如何选择低功耗模式 --------------------------------------- +.. todo - add sleep-current/esp32c5_summary.inc and sleep-current/esp32c61_summary.inc -在介绍具体内容前先给出 Wi-Fi 场景下低功耗模式总结表,以方便用户根据需求快速选择想要了解的内容,选择合适的低功耗模式。 +.. only:: not esp32c5 and not esp32c61 -.. todo - add sleep-current/esp32c5_summary.inc + Wi-Fi 场景如何选择低功耗模式 + -------------------------------------- -.. only:: not esp32c5 and not esp32c61 + 在介绍具体内容前先给出 Wi-Fi 场景下低功耗模式总结表,以方便用户根据需求快速选择想要了解的内容,选择合适的低功耗模式。 - .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_summary.inc -.. note:: + .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_summary.inc + + .. note:: 上表中所有电流均为平均电流,表中术语在下文均有介绍,用户可根据需求进行查看。 @@ -363,13 +364,13 @@ Modem-sleep 模式配置 * - ``light_sleep_enable`` - false -- 配置表现 + .. todo - add sleep-current/esp32c5_modem_sleep.inc sleep-current/esp32c61_modem_sleep.inc - .. todo - add sleep-current/esp32c5_modem_sleep.inc + .. only:: not esp32c5 and not esp32c61 - .. only:: not esp32c5 and not esp32c61 + - 配置表现 - .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_modem_sleep.inc + .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_modem_sleep.inc Auto Light-sleep 模式 + Wi-Fi 场景配置 @@ -377,15 +378,15 @@ Auto Light-sleep 模式 + Wi-Fi 场景配置 Auto Light-sleep 在 Wi-Fi 场景下的配置比纯系统下少了唤醒源的配置要求,其余几乎与纯系统下配置一致,因此可配置选项、配置步骤、推荐配置的详细介绍可以参考上文 :ref:`Deep-sleep 模式`。同时 Wi-Fi 相关配置保持默认。 -- 配置表现 +.. todo - add sleep-current/esp32c5_light_sleep.inc and leep-current/esp32c61_light_sleep.inc - 该配置表现为 Auto Light-sleep 模式纯系统推荐配置 + 默认的 Wi-Fi 相关配置在 Wi-Fi 场景的表现。 +.. only:: not esp32c5 and not esp32c61 - .. todo - add sleep-current/esp32c5_light_sleep.inc + - 配置表现 - .. only:: not esp32c5 and not esp32c61 + 该配置表现为 Auto Light-sleep 模式纯系统推荐配置 + 默认的 Wi-Fi 相关配置在 Wi-Fi 场景的表现。 - .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_light_sleep.inc + .. include:: ../sleep-current/{IDF_TARGET_PATH_NAME}_light_sleep.inc Deep-sleep 模式 + Wi-Fi 场景配置 +++++++++++++++++++++++++++++++++++ diff --git a/examples/openthread/.build-test-rules.yml b/examples/openthread/.build-test-rules.yml index 59b8f90ea8c..7518ec1873d 100644 --- a/examples/openthread/.build-test-rules.yml +++ b/examples/openthread/.build-test-rules.yml @@ -20,7 +20,7 @@ examples/openthread/ot_br: enable: - - if: SOC_WIFI_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5", "esp32c61"] + - if: SOC_WIFI_SUPPORTED == 1 and IDF_TARGET != "esp32c61" disable_test: - if: IDF_TARGET not in ["esp32s3"] reason: only test on esp32s3 diff --git a/examples/openthread/ot_br/README.md b/examples/openthread/ot_br/README.md index 1e8af0bddb2..fe3c90938af 100644 --- a/examples/openthread/ot_br/README.md +++ b/examples/openthread/ot_br/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | # OpenThread Border Router Example @@ -52,7 +52,7 @@ Two ways are provided to setup the Thread Border Router in this example: - Auto Start Enable `OPENTHREAD_BR_AUTO_START`, configure the `CONFIG_EXAMPLE_WIFI_SSID` and `CONFIG_EXAMPLE_WIFI_PASSWORD` with your access point's ssid and psk. -The device will connect to Wi-Fi and form a Thread network automatically after bootup. +The device will connect to Wi-Fi and form a Thread network automatically after boot up. - Manual mode Disable `OPENTHREAD_BR_AUTO_START` and enable `OPENTHREAD_CLI_ESP_EXTENSION`. `wifi` command will be added for connecting the device to the Wi-Fi network.