From 090b4aa1f3d6051db9ffdfcf09306cdbe0f472f9 Mon Sep 17 00:00:00 2001 From: morris Date: Sun, 2 Jan 2022 16:21:47 +0800 Subject: [PATCH 1/2] adc: make adc2_wifi share resource private --- components/driver/esp32c3/adc2_init_cal.c | 4 ++-- components/driver/esp32s2/adc2_init_cal.c | 4 ++-- .../adc2_wifi_private.h => esp_private/adc2_wifi.h} | 7 ++++--- components/esp_wifi/src/wifi_init.c | 4 ++-- docs/en/migration-guides/peripherals.rst | 5 +++++ 5 files changed, 15 insertions(+), 9 deletions(-) rename components/driver/include/{driver/adc2_wifi_private.h => esp_private/adc2_wifi.h} (93%) diff --git a/components/driver/esp32c3/adc2_init_cal.c b/components/driver/esp32c3/adc2_init_cal.c index 351e795024..bd8b32d985 100644 --- a/components/driver/esp32c3/adc2_init_cal.c +++ b/components/driver/esp32c3/adc2_init_cal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,8 +8,8 @@ The linker will link constructor (adc2_init_code_calibration) only when any sections inside the same file (adc2_cal_include) is used. Don't put any other code into this file. */ -#include "adc2_wifi_private.h" #include "hal/adc_hal.h" +#include "esp_private/adc2_wifi.h" #include "esp_private/adc_cali.h" /** diff --git a/components/driver/esp32s2/adc2_init_cal.c b/components/driver/esp32s2/adc2_init_cal.c index 351e795024..bd8b32d985 100644 --- a/components/driver/esp32s2/adc2_init_cal.c +++ b/components/driver/esp32s2/adc2_init_cal.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2016-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,8 +8,8 @@ The linker will link constructor (adc2_init_code_calibration) only when any sections inside the same file (adc2_cal_include) is used. Don't put any other code into this file. */ -#include "adc2_wifi_private.h" #include "hal/adc_hal.h" +#include "esp_private/adc2_wifi.h" #include "esp_private/adc_cali.h" /** diff --git a/components/driver/include/driver/adc2_wifi_private.h b/components/driver/include/esp_private/adc2_wifi.h similarity index 93% rename from components/driver/include/driver/adc2_wifi_private.h rename to components/driver/include/esp_private/adc2_wifi.h index 7330ab1b8e..669213fb3d 100644 --- a/components/driver/include/driver/adc2_wifi_private.h +++ b/components/driver/include/esp_private/adc2_wifi.h @@ -1,17 +1,18 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include "sdkconfig.h" +#include "esp_err.h" + #ifdef __cplusplus extern "C" { #endif -#include "esp_err.h" -#include "soc/soc_caps.h" /** * @brief For WIFI module to claim the usage of ADC2. diff --git a/components/esp_wifi/src/wifi_init.c b/components/esp_wifi/src/wifi_init.c index 6473272cd3..bfdbe9e61c 100644 --- a/components/esp_wifi/src/wifi_init.c +++ b/components/esp_wifi/src/wifi_init.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #include #include "esp_log.h" #include "esp_private/wifi.h" +#include "esp_private/adc2_wifi.h" #include "esp_pm.h" #include "esp_sleep.h" #include "esp_private/pm_impl.h" @@ -16,7 +17,6 @@ #include "esp_netif.h" #include "tcpip_adapter_compatible/tcpip_adapter_compat.h" #include "driver/adc.h" -#include "driver/adc2_wifi_private.h" #include "esp_coexist_internal.h" #include "esp_phy_init.h" #include "phy.h" diff --git a/docs/en/migration-guides/peripherals.rst b/docs/en/migration-guides/peripherals.rst index 6581925207..cac6a09a9a 100644 --- a/docs/en/migration-guides/peripherals.rst +++ b/docs/en/migration-guides/peripherals.rst @@ -16,3 +16,8 @@ Version before v5.0, spi flash functions in rom can be included by ``esp32**/rom Therefore, the common APIs are extracted to ``esp_rom_spiflash.h``. Although it's not a breaking change, it is strongly recommended to only use the functions with prefix ``esp_rom_spiflash`` included by ``esp_rom_spiflash.h`` for better cross-compatibility. To make the API clearer, we renamed the function ``esp_rom_spiflash_lock`` to ``esp_rom_spiflash_set_bp``. We renamed ``esp_rom_spiflash_unlock`` to ``esp_rom_spiflash_clear_bp``. + +ADC +--- + +Previous `driver/adc2_wifi_private.h` has been moved to `esp_private/adc2_wifi.h`. From 113cbb88a65f3eb70014bf9a1a99a8ce67455704 Mon Sep 17 00:00:00 2001 From: morris Date: Tue, 4 Jan 2022 14:10:03 +0800 Subject: [PATCH 2/2] hw_support: remove deprecated header files --- components/esp_hw_support/include/esp_intr.h | 9 --------- components/xtensa/include/esp_panic.h | 4 ---- docs/en/migration-guides/system.rst | 5 ++++- tools/ci/check_copyright_ignore.txt | 1 - 4 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 components/esp_hw_support/include/esp_intr.h delete mode 100644 components/xtensa/include/esp_panic.h diff --git a/components/esp_hw_support/include/esp_intr.h b/components/esp_hw_support/include/esp_intr.h deleted file mode 100644 index 0818ed3fea..0000000000 --- a/components/esp_hw_support/include/esp_intr.h +++ /dev/null @@ -1,9 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#warning esp_intr.h is deprecated, please include esp_intr_alloc.h instead -#include "esp_intr_alloc.h" diff --git a/components/xtensa/include/esp_panic.h b/components/xtensa/include/esp_panic.h deleted file mode 100644 index 587c7953b0..0000000000 --- a/components/xtensa/include/esp_panic.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once -#warning "esp_panic.h is deprecated, please use esp_debug_helpers.h or/and esp_private/panic_reason.h" -#include "esp_private/panic_reason.h" -#include "esp_debug_helpers.h" diff --git a/docs/en/migration-guides/system.rst b/docs/en/migration-guides/system.rst index 638273677a..d9237fa975 100644 --- a/docs/en/migration-guides/system.rst +++ b/docs/en/migration-guides/system.rst @@ -41,4 +41,7 @@ The header ``task_snapshot.h`` has been removed from ``freertos/task.h``. ESP-ID ESP HW Support -------------- -The header files ``soc/cpu.h`` have been deleted and deprecated CPU util functions have been removed. ESP-IDF developers should include ``esp_cpu.h`` instead for equivalent functions. + +- The header files ``soc/cpu.h`` have been deleted and deprecated CPU util functions have been removed. ESP-IDF developers should include ``esp_cpu.h`` instead for equivalent functions. +- The header file ``esp_intr.h`` has been deleted. Please include ``esp_intr_alloc.h`` to allocate and manipulate interrupts. +- The header file ``esp_panic.h`` has been deleted. ESP-IDF developers should include ``esp_private/panic_reason.h`` to get supported panic reasons. And should include ``esp_debug_helpers.h`` to use any debug related helper functions, e.g. print backtrace. diff --git a/tools/ci/check_copyright_ignore.txt b/tools/ci/check_copyright_ignore.txt index 9701c55383..5bd7910562 100644 --- a/tools/ci/check_copyright_ignore.txt +++ b/tools/ci/check_copyright_ignore.txt @@ -2442,7 +2442,6 @@ components/xtensa/esp32s3/include/xtensa/config/system.h components/xtensa/esp32s3/include/xtensa/config/tie-asm.h components/xtensa/esp32s3/include/xtensa/config/tie.h components/xtensa/include/eri.h -components/xtensa/include/esp_panic.h components/xtensa/include/esp_private/panic_reason.h components/xtensa/include/xt_instr_macros.h components/xtensa/include/xt_trax.h