From: Angus Gratton Date: Wed, 21 Aug 2019 02:45:09 +0000 (+1000) Subject: esp32/esp_common: Remove deprecated system_* APIs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bdeaf138c4c43314ce24309f800c366c2b754a45;p=esp-idf esp32/esp_common: Remove deprecated system_* APIs Mostly deprecated before ESP-IDF V1.0 & V2.0 --- diff --git a/components/esp32/system_api.c b/components/esp32/system_api.c index f017a0f650..a17d65a457 100644 --- a/components/esp32/system_api.c +++ b/components/esp32/system_api.c @@ -47,10 +47,6 @@ static uint8_t base_mac_addr[6] = { 0 }; #define SHUTDOWN_HANDLERS_NO 2 static shutdown_handler_t shutdown_handlers[SHUTDOWN_HANDLERS_NO]; -void system_init(void) -{ -} - esp_err_t esp_base_mac_addr_set(uint8_t *mac) { if (mac == NULL) { @@ -122,7 +118,6 @@ esp_err_t esp_efuse_mac_get_default(uint8_t* mac) return ESP_OK; } -esp_err_t system_efuse_read_mac(uint8_t *mac) __attribute__((alias("esp_efuse_mac_get_default"))); esp_err_t esp_efuse_read_mac(uint8_t *mac) __attribute__((alias("esp_efuse_mac_get_default"))); esp_err_t esp_derive_local_mac(uint8_t* local_mac, const uint8_t* universal_mac) @@ -344,8 +339,6 @@ void IRAM_ATTR esp_restart_noos(void) } } -void system_restart(void) __attribute__((alias("esp_restart"))); - uint32_t esp_get_free_heap_size( void ) { return heap_caps_get_free_size( MALLOC_CAP_DEFAULT ); @@ -356,13 +349,6 @@ uint32_t esp_get_minimum_free_heap_size( void ) return heap_caps_get_minimum_free_size( MALLOC_CAP_DEFAULT ); } -uint32_t system_get_free_heap_size(void) __attribute__((alias("esp_get_free_heap_size"))); - -const char* system_get_sdk_version(void) -{ - return "master"; -} - const char* esp_get_idf_version(void) { return IDF_VER; diff --git a/components/esp_common/include/esp_system.h b/components/esp_common/include/esp_system.h index 8ca977f16f..7fa028846e 100644 --- a/components/esp_common/include/esp_system.h +++ b/components/esp_common/include/esp_system.h @@ -58,22 +58,6 @@ typedef enum { ESP_RST_SDIO, //!< Reset over SDIO } esp_reset_reason_t; -/** @cond */ -/** - * @attention Applications don't need to call this function anymore. It does nothing and will - * be removed in future version. - */ -void system_init(void) __attribute__ ((deprecated)); - -/** - * @brief Reset to default settings. - * - * Function has been deprecated, please use esp_wifi_restore instead. - * This name will be removed in a future release. - */ -void system_restore(void) __attribute__ ((deprecated)); -/** @endcond */ - /** * Shutdown handler type */ @@ -113,32 +97,12 @@ esp_err_t esp_unregister_shutdown_handler(shutdown_handler_t handle); */ void esp_restart(void) __attribute__ ((noreturn)); -/** @cond */ -/** - * @brief Restart system. - * - * Function has been renamed to esp_restart. - * This name will be removed in a future release. - */ -void system_restart(void) __attribute__ ((deprecated, noreturn)); -/** @endcond */ - /** * @brief Get reason of last reset * @return See description of esp_reset_reason_t for explanation of each value. */ esp_reset_reason_t esp_reset_reason(void); -/** @cond */ -/** - * @brief Get system time, unit: microsecond. - * - * This function is deprecated. Use 'gettimeofday' function for 64-bit precision. - * This definition will be removed in a future release. - */ -uint32_t system_get_time(void) __attribute__ ((deprecated)); -/** @endcond */ - /** * @brief Get the size of available heap. * @@ -149,18 +113,6 @@ uint32_t system_get_time(void) __attribute__ ((deprecated)); */ uint32_t esp_get_free_heap_size(void); -/** @cond */ -/** - * @brief Get the size of available heap. - * - * Function has been renamed to esp_get_free_heap_size. - * This name will be removed in a future release. - * - * @return Available heap size, in bytes. - */ -uint32_t system_get_free_heap_size(void) __attribute__ ((deprecated)); -/** @endcond */ - /** * @brief Get the minimum heap that has ever been available * @@ -258,17 +210,6 @@ esp_err_t esp_efuse_mac_get_default(uint8_t *mac); * @return ESP_OK on success */ esp_err_t esp_efuse_read_mac(uint8_t *mac) __attribute__ ((deprecated)); - -/** - * @brief Read hardware MAC address. - * - * Function has been renamed to esp_efuse_mac_get_default. - * This name will be removed in a future release. - * - * @param mac hardware MAC address, length: 6 bytes. - * @return ESP_OK on success - */ -esp_err_t system_efuse_read_mac(uint8_t *mac) __attribute__ ((deprecated)); /** @endcond */ /** @@ -301,17 +242,6 @@ esp_err_t esp_read_mac(uint8_t* mac, esp_mac_type_t type); */ esp_err_t esp_derive_local_mac(uint8_t* local_mac, const uint8_t* universal_mac); -/** @cond */ -/** - * Get SDK version - * - * This function is deprecated and will be removed in a future release. - * - * @return constant string "master" - */ -const char* system_get_sdk_version(void) __attribute__ ((deprecated)); -/** @endcond */ - /** * @brief Chip models */ diff --git a/components/esp_wifi/CMakeLists.txt b/components/esp_wifi/CMakeLists.txt index 3b0e3d530e..1d239ed115 100644 --- a/components/esp_wifi/CMakeLists.txt +++ b/components/esp_wifi/CMakeLists.txt @@ -8,7 +8,6 @@ idf_component_register(SRCS "src/coexist.c" "src/lib_printf.c" "src/mesh_event.c" "src/phy_init.c" - "src/restore.c" "src/smartconfig.c" "src/smartconfig_ack.c" "src/wifi_init.c" diff --git a/components/esp_wifi/src/restore.c b/components/esp_wifi/src/restore.c deleted file mode 100644 index e17f1ab77e..0000000000 --- a/components/esp_wifi/src/restore.c +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "esp_system.h" -#include "esp_wifi.h" - -/* This function is in a separate file from the reset of system APIs because - * it causes link time dependency on WiFi stack. - */ -void system_restore(void) -{ - esp_wifi_restore(); -}