mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
fix(wifi): Run tools/format.sh on WiFi component
This commit is contained in:
@@ -38,7 +38,6 @@ void tearDown(void)
|
||||
check_leak(before_free_32bit, after_free_32bit, "32BIT");
|
||||
}
|
||||
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
ESP_ERROR_CHECK(nvs_flash_init());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -20,8 +20,8 @@ TEST_CASE("wifi set country code", "[wifi_init]")
|
||||
TEST_ESP_OK(esp_wifi_init(&cfg));
|
||||
|
||||
wifi_country_t country;
|
||||
wifi_country_t country_01 = {.cc="01", .schan=1, .nchan=11, .policy=WIFI_COUNTRY_POLICY_MANUAL};
|
||||
wifi_country_t country_CN = {.cc="CN", .schan=1, .nchan=13, .policy=WIFI_COUNTRY_POLICY_MANUAL};
|
||||
wifi_country_t country_01 = {.cc = "01", .schan = 1, .nchan = 11, .policy = WIFI_COUNTRY_POLICY_MANUAL};
|
||||
wifi_country_t country_CN = {.cc = "CN", .schan = 1, .nchan = 13, .policy = WIFI_COUNTRY_POLICY_MANUAL};
|
||||
|
||||
ESP_LOGI(TAG, EMPH_STR("esp_wifi_get_country (default)"));
|
||||
TEST_ESP_OK(esp_wifi_get_country(&country));
|
||||
@@ -34,7 +34,6 @@ TEST_CASE("wifi set country code", "[wifi_init]")
|
||||
TEST_ESP_OK(esp_wifi_get_country(&country));
|
||||
TEST_ASSERT(country.cc[0] == country_CN.cc[0] && country.cc[1] == country_CN.cc[1]);
|
||||
|
||||
|
||||
ESP_LOGI(TAG, EMPH_STR("esp_wifi_deinit"));
|
||||
TEST_ESP_OK(esp_wifi_deinit());
|
||||
|
||||
@@ -55,7 +54,6 @@ TEST_CASE("wifi set country code", "[wifi_init]")
|
||||
TEST_ESP_OK(esp_wifi_get_country_code(&country_code_string[0]));
|
||||
TEST_ASSERT(country_code_string[0] == country_code_string_CN[0] && country_code_string[1] == country_code_string_CN[1]);
|
||||
|
||||
|
||||
ESP_LOGI(TAG, EMPH_STR("esp_wifi_deinit"));
|
||||
TEST_ESP_OK(esp_wifi_deinit());
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -15,24 +15,23 @@
|
||||
|
||||
#define EMPH_STR(s) "****** "s" ******"
|
||||
|
||||
|
||||
static const char* TAG = "test_wifi_init";
|
||||
|
||||
static void wifi_event_handler(void* arg, esp_event_base_t event_base, int32_t event_id, void* event_data)
|
||||
{
|
||||
printf("wifi event handle called.\n");
|
||||
switch(event_id) {
|
||||
case WIFI_EVENT_AP_START:
|
||||
ESP_LOGI(TAG, "WIFI_EVENT_AP_START");
|
||||
break;
|
||||
case WIFI_EVENT_STA_START:
|
||||
ESP_LOGI(TAG, "WIFI_EVENT_STA_START");
|
||||
break;
|
||||
case WIFI_EVENT_STA_DISCONNECTED:
|
||||
ESP_LOGI(TAG, "WIFI_EVENT_STA_DISCONNECTED");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
switch (event_id) {
|
||||
case WIFI_EVENT_AP_START:
|
||||
ESP_LOGI(TAG, "WIFI_EVENT_AP_START");
|
||||
break;
|
||||
case WIFI_EVENT_STA_START:
|
||||
ESP_LOGI(TAG, "WIFI_EVENT_STA_START");
|
||||
break;
|
||||
case WIFI_EVENT_STA_DISCONNECTED:
|
||||
ESP_LOGI(TAG, "WIFI_EVENT_STA_DISCONNECTED");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -46,7 +45,7 @@ static esp_err_t event_init(void)
|
||||
|
||||
static esp_err_t event_deinit(void)
|
||||
{
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(WIFI_EVENT,ESP_EVENT_ANY_ID,&wifi_event_handler));
|
||||
ESP_ERROR_CHECK(esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, &wifi_event_handler));
|
||||
ESP_ERROR_CHECK(esp_event_loop_delete_default());
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -75,9 +74,9 @@ TEST_CASE("wifi driver can start on APP CPU", "[wifi_init]")
|
||||
TEST_ASSERT_NOT_NULL(sema);
|
||||
printf("Creating tasks\n");
|
||||
#ifndef CONFIG_FREERTOS_UNICORE
|
||||
xTaskCreatePinnedToCore(wifi_driver_can_start_on_APP_CPU_task, "wifi_driver_can_start_on_APP_CPU_task", 2048*2, &sema, 3, &th, 1);
|
||||
xTaskCreatePinnedToCore(wifi_driver_can_start_on_APP_CPU_task, "wifi_driver_can_start_on_APP_CPU_task", 2048 * 2, &sema, 3, &th, 1);
|
||||
#else
|
||||
xTaskCreate(wifi_driver_can_start_on_APP_CPU_task, "wifi_driver_can_start_on_APP_CPU_task", 2048*2, &sema, 3, &th);
|
||||
xTaskCreate(wifi_driver_can_start_on_APP_CPU_task, "wifi_driver_can_start_on_APP_CPU_task", 2048 * 2, &sema, 3, &th);
|
||||
#endif
|
||||
TEST_ASSERT_NOT_NULL(th);
|
||||
xSemaphoreTake(sema, portMAX_DELAY);
|
||||
|
||||
Reference in New Issue
Block a user