Bläddra i källkod

adc: make adc2_wifi share resource private

morris 4 år sedan
förälder
incheckning
090b4aa1f3

+ 2 - 2
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"
 
 /**

+ 2 - 2
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"
 
 /**

+ 4 - 3
components/driver/include/driver/adc2_wifi_private.h → 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.

+ 2 - 2
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 <esp_wifi.h>
 #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"

+ 5 - 0
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`.