From 21693c3c7c72dc886f7f5299bdfc875e0ac472b0 Mon Sep 17 00:00:00 2001 From: alanmaxwell Date: Tue, 26 Mar 2024 14:12:58 +0800 Subject: [PATCH] fix(ci): disable phy antenna example build for h2 and fix typo and format --- components/esp_wifi/include/esp_wifi.h | 8 ++++---- examples/phy/.build-test-rules.yml | 2 +- examples/phy/antenna/README.md | 8 ++++---- .../components/antenna_soft_switch/antenna_switch.c | 6 +++--- examples/phy/antenna/main/Kconfig.projbuild | 4 ++-- examples/phy/antenna/main/antenna_switch_example_main.c | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/components/esp_wifi/include/esp_wifi.h b/components/esp_wifi/include/esp_wifi.h index 6e084bb195..5079b91c1d 100644 --- a/components/esp_wifi/include/esp_wifi.h +++ b/components/esp_wifi/include/esp_wifi.h @@ -453,7 +453,7 @@ esp_err_t esp_wifi_deauth_sta(uint16_t aid); * * @param config configuration settings for scanning, if set to NULL default settings will be used * of which default values are show_hidden:false, scan_type:active, scan_time.active.min:0, - * scan_time.active.max:120 miliseconds, scan_time.passive:360 miliseconds + * scan_time.active.max:120 milliseconds, scan_time.passive:360 milliseconds * * @param block if block is true, this API will block the caller until the scan is done, otherwise * it will return immediately @@ -659,7 +659,7 @@ esp_err_t esp_wifi_get_bandwidth(wifi_interface_t ifx, wifi_bandwidth_t *bw); * @attention 2. When device is in STA mode, this API should not be called when STA is scanning or connecting to an external AP * @attention 3. When device is in softAP mode, this API should not be called when softAP has connected to external STAs * @attention 4. When device is in STA+softAP mode, this API should not be called when in the scenarios described above - * @attention 5. The channel info set by this API will not be stored in NVS. So If you want to remeber the channel used before wifi stop, + * @attention 5. The channel info set by this API will not be stored in NVS. So If you want to remember the channel used before wifi stop, * you need to call this API again after wifi start, or you can call `esp_wifi_set_config()` to store the channel info in NVS. * * @param primary for HT20, primary is the channel number, for HT40, primary is the primary channel @@ -1018,7 +1018,7 @@ esp_err_t esp_wifi_set_vendor_ie_cb(esp_vendor_ie_cb_t cb, void *ctx); esp_err_t esp_wifi_set_max_tx_power(int8_t power); /** - * @brief Get maximum transmiting power after WiFi start + * @brief Get maximum transmitting power after WiFi start * * @param power Maximum WiFi transmitting power, unit is 0.25dBm. * @@ -1311,7 +1311,7 @@ esp_err_t esp_wifi_ftm_resp_set_offset(int16_t offset_cm); * valid FTM measurements in the buffer. Total number of entries can be found in the event * WIFI_EVENT_FTM_REPORT as ftm_report_num_entries * @attention 2. The internal FTM report is freed upon use of this API which means the API can only be used - * once afer every FTM session initiated + * once after every FTM session initiated * @attention 3. Passing the buffer as NULL merely frees the FTM report * * @param report Pointer to the buffer for receiving the FTM report diff --git a/examples/phy/.build-test-rules.yml b/examples/phy/.build-test-rules.yml index 5c9b78a70d..a4e5e12abd 100644 --- a/examples/phy/.build-test-rules.yml +++ b/examples/phy/.build-test-rules.yml @@ -2,7 +2,7 @@ examples/phy/antenna: disable: - - if: IDF_TARGET == "esp32p4" + - if: IDF_TARGET in ["esp32p4", "esp32h2"] reason: not supported examples/phy/cert_test: enable: diff --git a/examples/phy/antenna/README.md b/examples/phy/antenna/README.md index b26a2c5df6..8551b80717 100644 --- a/examples/phy/antenna/README.md +++ b/examples/phy/antenna/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | # Wi-Fi antenna soft switch Example @@ -49,7 +49,7 @@ I (599) system_api: Base MAC address is not set, read default base MAC address f I (599) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (629) wifi: wifi firmware version: 2d94f02 I (629) wifi: config NVS flash: enabled -I (629) wifi: config nano formating: disabled +I (629) wifi: config nano formatting: disabled I (629) wifi: Init dynamic tx buffer num: 32 I (629) wifi: Init data frame dynamic rx buffer num: 32 I (639) wifi: Init management frame dynamic rx buffer num: 32 @@ -94,7 +94,7 @@ I (599) system_api: Base MAC address is not set, read default base MAC address f I (599) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE I (629) wifi: wifi firmware version: 2d94f02 I (629) wifi: config NVS flash: enabled -I (629) wifi: config nano formating: disabled +I (629) wifi: config nano formatting: disabled I (629) wifi: Init dynamic tx buffer num: 32 I (629) wifi: Init data frame dynamic rx buffer num: 32 I (639) wifi: Init management frame dynamic rx buffer num: 32 diff --git a/examples/phy/antenna/components/antenna_soft_switch/antenna_switch.c b/examples/phy/antenna/components/antenna_soft_switch/antenna_switch.c index 97cdd43933..68435fd4be 100644 --- a/examples/phy/antenna/components/antenna_soft_switch/antenna_switch.c +++ b/examples/phy/antenna/components/antenna_soft_switch/antenna_switch.c @@ -244,13 +244,13 @@ static void antenna_soft_switching_task(void *arg) if (rssi_flag > WAIT_TIME) { ESP_LOGD(TAG, "End of listening rssi"); /**< Ambient noise factor: abs(rssi_last_sum - rssi_sum) * RSSI_KD*/ - int16_t ans = abs(rssi_save_sum - rssi_sum) - abs(rssi_last_sum - rssi_sum) * RSSI_KD; + int16_t and = abs(rssi_save_sum - rssi_sum) - abs(rssi_last_sum - rssi_sum) * RSSI_KD; rssi_flag = 0; - if(ans > (config->ant_switch)) { + if(and > (config->ant_switch)) { /**< Determine that the signal has changed*/ queue_rssi_sum_size = 0; queue_rssi_single_size = 0; - ESP_LOGD(TAG, "monitor result:%d > %d", ans, (config->ant_switch)); + ESP_LOGD(TAG, "monitor result:%d > %d", and, (config->ant_switch)); /**< Select the optimal antenna*/ antenna_switch_function(config); /**< Wait for parameters to take effect*/ diff --git a/examples/phy/antenna/main/Kconfig.projbuild b/examples/phy/antenna/main/Kconfig.projbuild index a43c1b8f53..0baf98fbc5 100644 --- a/examples/phy/antenna/main/Kconfig.projbuild +++ b/examples/phy/antenna/main/Kconfig.projbuild @@ -23,8 +23,8 @@ menu "Example Configuration" default ESP_WIFI_AUTH_WPA2_PSK help The weakest authmode to accept in the scan mode. - This value defaults to ESP_WIFI_AUTH_WPA2_PSK incase password is present and ESP_WIFI_AUTH_OPEN is used. - Please select ESP_WIFI_AUTH_WEP/ESP_WIFI_AUTH_WPA_PSK incase AP is operating in WEP/WPA mode. + This value defaults to ESP_WIFI_AUTH_WPA2_PSK in case password is present and ESP_WIFI_AUTH_OPEN is used. + Please select ESP_WIFI_AUTH_WEP/ESP_WIFI_AUTH_WPA_PSK in case AP is operating in WEP/WPA mode. config ESP_WIFI_AUTH_OPEN bool "OPEN" diff --git a/examples/phy/antenna/main/antenna_switch_example_main.c b/examples/phy/antenna/main/antenna_switch_example_main.c index c40a23c320..c81a07458e 100644 --- a/examples/phy/antenna/main/antenna_switch_example_main.c +++ b/examples/phy/antenna/main/antenna_switch_example_main.c @@ -117,7 +117,7 @@ void wifi_init_sta(void) .sta = { .ssid = EXAMPLE_ESP_WIFI_SSID, .password = EXAMPLE_ESP_WIFI_PASS, - /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (pasword len => 8). + /* Authmode threshold resets to WPA2 as default if password matches WPA2 standards (password len => 8). * If you want to connect the device to deprecated WEP/WPA networks, Please set the threshold value * to WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK and set the password with length and format matching to * WIFI_AUTH_WEP/WIFI_AUTH_WPA_PSK standards.